Skip to content

[Dev]: Dev<->Master #4315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
00a8744
Kotlin multiplatform leaking memory (#4037)
vcoolish Oct 1, 2024
2ed7098
[KMP] Fix issue: memory leak found in Base58.decode in iOS (#4031)
10gic Oct 1, 2024
5137601
Merge branch 'master' into dev
satoshiotomakan Oct 4, 2024
0b16771
[TON]: Add support for TON 24-words mnemonic (#3998)
satoshiotomakan Oct 4, 2024
b1f4543
Merge branch 'master' into dev
satoshiotomakan Oct 14, 2024
5d6f5b9
Merge branch 'master' into dev
satoshiotomakan Oct 15, 2024
aeb534d
Merge branch 'master' into dev
satoshiotomakan Oct 25, 2024
8121243
Fix Java JVM leak (#4092)
vcoolish Nov 4, 2024
e41d66f
Merge branch 'master' into dev
satoshiotomakan Nov 4, 2024
c61daac
[Chore]: Fix Android bindings (#4095)
satoshiotomakan Nov 5, 2024
0479584
Fix memory lead found in public key in kmp binding (#4097)
10gic Nov 6, 2024
77538af
Merge branch 'master' into dev
satoshiotomakan Nov 6, 2024
7409aa9
Merge branch 'master' into dev
satoshiotomakan Nov 22, 2024
20208f0
Update Callisto explorer (#4131)
vcoolish Nov 26, 2024
4411f22
Merge branch 'master' into dev
satoshiotomakan Nov 28, 2024
c007547
Revert "[TON]: Add support for TON 24-words mnemonic (#3998)" (#4148)
satoshiotomakan Dec 5, 2024
d4af84a
Merge branch 'master' into dev
satoshiotomakan Dec 17, 2024
dee25d4
Merge branch 'master' into dev
satoshiotomakan Dec 19, 2024
8b2cdb7
Fix JVM synchronization issue (#4218)
vcoolish Jan 16, 2025
28ced94
Merge branch 'master' into dev
satoshiotomakan Jan 16, 2025
4f47e13
[Misc]: Fix Clippy warnings
satoshiotomakan Jan 16, 2025
f2dff8d
Merge branch 'master' into dev
satoshiotomakan Mar 18, 2025
14d33aa
Generate FFI headers in include/TrustWalletCore/Generated folder (#4303)
gupnik Mar 18, 2025
70a2a40
Fixes Docker and Cocoapods builds (#4317)
gupnik Mar 20, 2025
b5f6004
[BreakingChange]: Migrates FFI Tests to Private Key V2 APIs (#4333)
gupnik Mar 28, 2025
36f71ec
Merge master into dev (#4337)
gupnik Mar 28, 2025
2afdd7f
Merge master into dev again to fix conflicts (#4339)
gupnik Apr 2, 2025
6b46c47
Migrates PrivateKey and PublicKey implementation to Rust (#4347)
gupnik Apr 4, 2025
504d5f3
Merge master to dev (#4358)
gupnik Apr 9, 2025
d747d98
Merge branch 'master' into dev
satoshiotomakan Apr 9, 2025
e374216
Migrates `scrypt.c` to Rust (#4366)
gupnik Apr 17, 2025
2aaffee
Migrates `pbkdf2.c` to rust (#4367)
gupnik Apr 17, 2025
f694d32
Replaces `aeskey.c` with Rust implementation via FFI (#4377)
gupnik Apr 25, 2025
eb4d6fc
Replaces `bip39.c` with Rust implementation via FFI (#4384)
gupnik Apr 30, 2025
5482149
Migrates Key derivation to Rust (#4395)
gupnik May 19, 2025
ee9430d
Remove trezor crypto (#4404)
gupnik May 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PointerAlignment: Left
IncludeCategories:
- Regex: '^"\.\./'
Priority: 2
- Regex: '^<(TrustWalletCore|TrezorCrypto)/'
- Regex: '^<(TrustWalletCore)/'
Priority: 3
- Regex: '<.*>'
Priority: 4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codegen-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
tools/install-sys-dependencies-linux

- name: Run sccache-cache
uses: mozilla-actions/[email protected].3
uses: mozilla-actions/[email protected].8

- name: Install Rust dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux-ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
tools/install-sys-dependencies-linux

- name: Run sccache-cache
uses: mozilla-actions/[email protected].3
uses: mozilla-actions/[email protected].8

- name: Cache Rust
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
tools/install-sys-dependencies-linux

- name: Run sccache-cache
uses: mozilla-actions/[email protected].3
uses: mozilla-actions/[email protected].8

- name: Cache Rust
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
tools/install-sys-dependencies-mac

- name: Run sccache-cache
uses: mozilla-actions/[email protected].3
uses: mozilla-actions/[email protected].8

- name: Cache Rust
uses: Swatinem/rust-cache@v2
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ jobs:
CXX: /usr/bin/clang++
- name: Build and test
run: |
ninja -Cbuild tests TrezorCryptoTests
build/trezor-crypto/crypto/tests/TrezorCryptoTests
ninja -Cbuild tests
build/tests/tests --gtest_output=xml
env:
CC: /usr/bin/clang
Expand Down
12 changes: 1 addition & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,11 @@ codegen-v2/bindings/

src/Generated/*.h
src/Generated/*.cpp
include/TrustWalletCore/Generated/*.h
include/TrustWalletCore/TWHRP.h
include/TrustWalletCore/TW*Proto.h
include/TrustWalletCore/TWEthereumChainID.h

# Generated
include/TrustWalletCore/TWTONAddressConverter.h
include/TrustWalletCore/TWFFITest.h
include/TrustWalletCore/TWTONWallet.h
include/TrustWalletCore/TWTONMessageSigner.h
include/TrustWalletCore/TWMessageSigner.h
include/TrustWalletCore/TWWalletConnectRequest.h
include/TrustWalletCore/TWSolanaTransaction.h
include/TrustWalletCore/TWCryptoBoxPublicKey.h
include/TrustWalletCore/TWCryptoBoxSecretKey.h

# Wasm
emsdk/
wasm-build/
Expand Down
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ target_link_directories(${PROJECT_NAME}_INTERFACE INTERFACE ${PREFIX}/lib)
target_link_directories(${PROJECT_NAME}_INTERFACE INTERFACE ${WALLET_CORE_RS_TARGET_DIR}/release)
set_project_warnings(${PROJECT_NAME}_INTERFACE)

add_subdirectory(trezor-crypto)
set(WALLET_CORE_RS_LIB libwallet_core_rs.a)

set(WALLET_CORE_BINDGEN ${WALLET_CORE_RS_TARGET_DIR}/release/${WALLET_CORE_RS_LIB})
Expand Down Expand Up @@ -72,7 +71,7 @@ if (${ANDROID})
elseif (${CMAKE_ANDROID_ARCH_ABI} STREQUAL "x86_64")
set(WALLET_CORE_BINDGEN ${WALLET_CORE_RS_TARGET_DIR}/x86_64-linux-android/release/${WALLET_CORE_RS_LIB})
endif ()
target_link_libraries(TrustWalletCore PUBLIC ${WALLET_CORE_BINDGEN} ${PROJECT_NAME}_INTERFACE PRIVATE TrezorCrypto protobuf ${log-lib} Boost::boost)
target_link_libraries(TrustWalletCore PUBLIC ${WALLET_CORE_BINDGEN} ${PROJECT_NAME}_INTERFACE PRIVATE protobuf ${log-lib} Boost::boost)
elseif (${TW_COMPILE_JAVA})
message("Configuring for JNI")
file(GLOB_RECURSE core_sources src/*.c src/*.cc src/*.cpp src/*.h jni/cpp/*.cpp jni/cpp/*.h)
Expand All @@ -90,12 +89,12 @@ elseif (${TW_COMPILE_JAVA})
add_library(TrustWalletCore SHARED ${sources} ${PROTO_SRCS} ${PROTO_HDRS})
find_package(JNI REQUIRED)
target_include_directories(TrustWalletCore PRIVATE ${JNI_INCLUDE_DIRS})
target_link_libraries(TrustWalletCore PUBLIC ${WALLET_CORE_BINDGEN} ${PROJECT_NAME}_INTERFACE PRIVATE TrezorCrypto protobuf Boost::boost)
target_link_libraries(TrustWalletCore PUBLIC ${WALLET_CORE_BINDGEN} ${PROJECT_NAME}_INTERFACE PRIVATE protobuf Boost::boost)
else ()
message("Configuring standalone")
file(GLOB_RECURSE sources src/*.c src/*.cc src/*.cpp src/*.h)
add_library(TrustWalletCore STATIC ${sources} ${PROTO_SRCS} ${PROTO_HDRS})
target_link_libraries(TrustWalletCore PUBLIC ${WALLET_CORE_BINDGEN} ${PROJECT_NAME}_INTERFACE PRIVATE TrezorCrypto protobuf Boost::boost)
target_link_libraries(TrustWalletCore PUBLIC ${WALLET_CORE_BINDGEN} ${PROJECT_NAME}_INTERFACE PRIVATE protobuf Boost::boost)
endif ()

if (TW_CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ENV CXX=/usr/bin/clang++-14
RUN wget "https://sh.rustup.rs" -O rustup.sh \
&& sh rustup.sh -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup default nightly-2024-06-13
RUN rustup default nightly-2025-01-16
RUN cargo install --force cbindgen \
&& rustup target add wasm32-unknown-emscripten

Expand Down
11 changes: 1 addition & 10 deletions WalletCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Pod::Spec.new do |s|
'swift/Sources/*.{swift,h,m,cpp}',
'swift/Sources/Extensions/*.swift',
'swift/Sources/Generated/*.{swift,h}',
'trezor-crypto/crypto/**/*.{c,h}',
'trezor-crypto/include/**/*.{h}',
"#{protobuf_source_dir}/src/google/protobuf/any.cc",
"#{protobuf_source_dir}/src/google/protobuf/any.pb.cc",
"#{protobuf_source_dir}/src/google/protobuf/any_lite.cc",
Expand Down Expand Up @@ -125,32 +123,25 @@ Pod::Spec.new do |s|
"#{protobuf_source_dir}/src/google/protobuf/wrappers.pb.cc"

ss.exclude_files =
'trezor-crypto/include/TrezorCrypto/base58.h',
'trezor-crypto/crypto/monero',
'trezor-crypto/crypto/tests',
'trezor-crypto/crypto/tools',
'trezor-crypto/crypto/rand.c',
'src/rand.cpp',
'swift/Sources/Generated/WalletCore.h'

ss.public_header_files =
'include/**/*.h',
'swift/Sources/*.h'

ss.preserve_paths =
'trezor-crypto/crypto/*.{table}',
"#{protobuf_source_dir}/src/**/*.{h,inc}",
"#{include_dir}/nlohmann/**/*.hpp",
'src/proto/*.proto'

ss.xcconfig = {
'HEADER_SEARCH_PATHS' => '$(inherited) ' \
'$(SRCROOT)/../../wallet-core ' \
'${SRCROOT}/../../trezor-crypto/crypto ',
'SYSTEM_HEADER_SEARCH_PATHS' => '$(inherited) ' \
'/usr/local/include ' \
'${SRCROOT}/../../include ' \
'${SRCROOT}/../../../build/local/include ' \
"${SRCROOT}/../../trezor-crypto/include " \
"${SRCROOT}/../../protobuf ",
'GCC_WARN_UNUSED_FUNCTION' => 'NO',
'GCC_WARN_64_TO_32_BIT_CONVERSION' => 'NO',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestAcalaAddress {

@Test
fun testAddress() {
val key = PrivateKey("0x9066aa168c379a403becb235c15e7129c133c244e56a757ab07bc369288bcab0".toHexByteArray())
val key = PrivateKey("0x9066aa168c379a403becb235c15e7129c133c244e56a757ab07bc369288bcab0".toHexByteArray(), CoinType.ACALA.curve())
val pubkey = key.publicKeyEd25519
val address = AnyAddress(pubkey, CoinType.ACALA)
assertEquals(address.description(), "269ZCS3WLGydTN8ynhyhZfzJrXkePUcdhwgLQs6TWFs5wVL5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TestAcalaEVMAddress {

@Test
fun testAddress() {
val key = PrivateKey("828c4c48c2cef521f0251920891ed79e871faa24f64f43cde83d07bc99f8dbf0".toHexByteArray())
val key = PrivateKey("828c4c48c2cef521f0251920891ed79e871faa24f64f43cde83d07bc99f8dbf0".toHexByteArray(), CoinType.ACALAEVM.curve())
val pubkey = key.getPublicKeySecp256k1(false)
val address = AnyAddress(pubkey, CoinType.ACALAEVM)
val expected = AnyAddress("0xe32DC46bfBF78D1eada7b0a68C96903e01418D64", CoinType.ACALAEVM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestAgoricAddress {
@Test
fun testAddress() {

val key = PrivateKey("037048190544fa57651452f477c096de4f3073e7835cf3845b04602563a73f73".toHexByteArray())
val key = PrivateKey("037048190544fa57651452f477c096de4f3073e7835cf3845b04602563a73f73".toHexByteArray(), CoinType.AGORIC.curve())
val pubkey = key.getPublicKeySecp256k1(true)
val address = AnyAddress(pubkey, CoinType.AGORIC)
val expected = AnyAddress("agoric18zvvgk6j3eq5wd7mqxccgt20gz2w94cy88aek5", CoinType.AGORIC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TestAgoricSigner {

@Test
fun AgoricTransactionSigning() {
val key = PrivateKey("037048190544fa57651452f477c096de4f3073e7835cf3845b04602563a73f73".toHexByteArray())
val key = PrivateKey("037048190544fa57651452f477c096de4f3073e7835cf3845b04602563a73f73".toHexByteArray(), CoinType.AGORIC.curve())
val publicKey = key.getPublicKeySecp256k1(true)
val from = AnyAddress(publicKey, CoinType.AGORIC).description()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TestAionAddress {

@Test
fun testAddressFromPublicKey() {
val privateKey = PrivateKey("db33ffdf82c7ba903daf68d961d3c23c20471a8ce6b408e52d579fd8add80cc9".toHexByteArray())
val privateKey = PrivateKey("db33ffdf82c7ba903daf68d961d3c23c20471a8ce6b408e52d579fd8add80cc9".toHexByteArray(), CoinType.AION.curve())
val publicKey = privateKey.getPublicKeyEd25519()
val address = AnyAddress(publicKey, CoinType.AION)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TestAlgorandAddress {

@Test
fun testAddress() {
val key = PrivateKey("a6c4394041e64fe93d889386d7922af1b9a87f12e433762759608e61434d6cf7".toHexByteArray())
val key = PrivateKey("a6c4394041e64fe93d889386d7922af1b9a87f12e433762759608e61434d6cf7".toHexByteArray(), CoinType.ALGORAND.curve())
val pubkey = key.publicKeyEd25519
val address = AnyAddress(pubkey, CoinType.ALGORAND)
val expected = AnyAddress("ADIYK65L3XR5ODNNCUIQVEET455L56MRKJHRBX5GU4TZI2752QIWK4UL5A", CoinType.ALGORAND)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestBandChainAddress {
@Test
fun testAddress() {

val key = PrivateKey("1037f828ca313f4c9e120316e8e9ff25e17f07fe66ba557d5bc5e2eeb7cba8f6".toHexByteArray())
val key = PrivateKey("1037f828ca313f4c9e120316e8e9ff25e17f07fe66ba557d5bc5e2eeb7cba8f6".toHexByteArray(), CoinType.BANDCHAIN.curve())
val publicKey = key.getPublicKeySecp256k1(true)
val address = AnyAddress(publicKey, CoinType.BANDCHAIN)
val expected = AnyAddress("band1jf9aaj9myrzsnmpdr7twecnaftzmku2mgms4n3", CoinType.BANDCHAIN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.AnyAddress
import wallet.core.jni.CoinType
import wallet.core.jni.CoinType.BANDCHAIN
import wallet.core.jni.PrivateKey
import wallet.core.jni.proto.Cosmos
Expand All @@ -24,7 +25,7 @@ class TestBandChainSigner {
@Test
fun testSigningTransaction() {
val key =
PrivateKey("80e81ea269e66a0a05b11236df7919fb7fbeedba87452d667489d7403a02f005".toHexByteArray())
PrivateKey("80e81ea269e66a0a05b11236df7919fb7fbeedba87452d667489d7403a02f005".toHexByteArray(), CoinType.BANDCHAIN.curve())
val publicKey = key.getPublicKeySecp256k1(true)
val from = AnyAddress(publicKey, BANDCHAIN).description()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class TestBinanceTransactionSigning {
System.loadLibrary("TrustWalletCore")
}

val testKey = PrivateKey("eeba3f6f2db26ced519a3d4c43afff101db957a21d54d25dc7fd235c404d7a5d".toHexBytes())
val testKey = PrivateKey("eeba3f6f2db26ced519a3d4c43afff101db957a21d54d25dc7fd235c404d7a5d".toHexBytes(), BINANCE.curve())

@Test
fun testSignBinanceTransaction() {
val privateKey = PrivateKey("95949f757db1f57ca94a5dff23314accbe7abee89597bf6a3c7382c84d7eb832".toHexBytes())
val privateKey = PrivateKey("95949f757db1f57ca94a5dff23314accbe7abee89597bf6a3c7382c84d7eb832".toHexBytes(), BINANCE.curve())
val publicKey = privateKey.getPublicKeySecp256k1(true)

val signingInput = Binance.SigningInput.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class TestBitcoinPsbt {
fun testPlanThorSwap() {
// Successfully broadcasted tx: https://mempool.space/tx/634a416e82ac710166725f6a4090ac7b5db69687e86b2d2e38dcb3d91c956c32

val privateKey = PrivateKey("f00ffbe44c5c2838c13d2778854ac66b75e04eb6054f0241989e223223ad5e55".toHexBytes())
val privateKey = PrivateKey("f00ffbe44c5c2838c13d2778854ac66b75e04eb6054f0241989e223223ad5e55".toHexBytes(), CoinType.BITCOIN.curve())
val publicKey = privateKey.getPublicKeySecp256k1(true)
val psbt = "70736274ff0100bc0200000001147010db5fbcf619067c1090fec65c131443fbc80fb4aaeebe940e44206098c60000000000ffffffff0360ea000000000000160014f22a703617035ef7f490743d50f26ae08c30d0a70000000000000000426a403d3a474149412e41544f4d3a636f736d6f7331737377797a666d743675396a373437773537753438746778646575393573757a666c6d7175753a303a743a35303e12000000000000160014b139199ec796f36fc42e637f42da8e3e6720aa9d000000000001011f6603010000000000160014b139199ec796f36fc42e637f42da8e3e6720aa9d00000000".toHexBytesInByteString()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class TestBitcoinSigning {
val dustSatoshis = 546.toLong()
val txId = Numeric.hexStringToByteArray("8ec895b4d30adb01e38471ca1019bfc8c3e5fbd1f28d9e7b5653260d89989008").reversedArray()

val privateKey = PrivateKey(privateKeyData)
val privateKey = PrivateKey(privateKeyData, CoinType.BITCOIN.curve())
val publicKey = ByteString.copyFrom(privateKey.getPublicKeySecp256k1(true).data())

val utxo0 = BitcoinV2.Input.newBuilder()
Expand Down Expand Up @@ -235,7 +235,7 @@ class TestBitcoinSigning {
val dustSatoshis = 546.toLong()
val txIdCommit = Numeric.hexStringToByteArray("797d17d47ae66e598341f9dfdea020b04d4017dcf9cc33f0e51f7a6082171fb1").reversedArray()

val privateKey = PrivateKey(privateKeyData)
val privateKey = PrivateKey(privateKeyData, CoinType.BITCOIN.curve())
val publicKey = ByteString.copyFrom(privateKey.getPublicKeySecp256k1(true).data())

val utxo0 = BitcoinV2.Input.newBuilder()
Expand Down Expand Up @@ -295,7 +295,7 @@ class TestBitcoinSigning {
val txIdInscription = Numeric.hexStringToByteArray("7046dc2689a27e143ea2ad1039710885147e9485ab6453fa7e87464aa7dd3eca").reversedArray()
val txIdForFees = Numeric.hexStringToByteArray("797d17d47ae66e598341f9dfdea020b04d4017dcf9cc33f0e51f7a6082171fb1").reversedArray()

val privateKey = PrivateKey(privateKeyData)
val privateKey = PrivateKey(privateKeyData, CoinType.BITCOIN.curve())
val publicKey = ByteString.copyFrom(privateKey.getPublicKeySecp256k1(true).data())
val bobAddress = "bc1qazgc2zhu2kmy42py0vs8d7yff67l3zgpwfzlpk"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestBitcoinDiamondAddress {

@Test
fun testAddress() {
val key = PrivateKey("d2b9f2846d3adcead910ee0124a3ba7ae29e8a4729787d27f9bea1f532928eee".toHexByteArray())
val key = PrivateKey("d2b9f2846d3adcead910ee0124a3ba7ae29e8a4729787d27f9bea1f532928eee".toHexByteArray(), CoinType.BITCOINDIAMOND.curve())
val pubkey = key.getPublicKeySecp256k1(true);
val address = AnyAddress(pubkey, CoinType.BITCOINDIAMOND)
val expected = AnyAddress("1G15VvshDxwFTnahZZECJfFwEkq9fP79o8", CoinType.BITCOINDIAMOND)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestBluzelleAddress {
@Test
fun testAddressPublicKey() {

val key = PrivateKey("1037f828ca313f4c9e120316e8e9ff25e17f07fe66ba557d5bc5e2eeb7cba8f6".toHexByteArray())
val key = PrivateKey("1037f828ca313f4c9e120316e8e9ff25e17f07fe66ba557d5bc5e2eeb7cba8f6".toHexByteArray(), CoinType.BLUZELLE.curve())
val publicKey = key.getPublicKeySecp256k1(true)
val expectedAddress = "bluzelle1jf9aaj9myrzsnmpdr7twecnaftzmku2myvn4dg"
val actualAddress = AnyAddress(publicKey, CoinType.BLUZELLE).description()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.junit.Assert.assertEquals
import org.junit.Test
import wallet.core.java.AnySigner
import wallet.core.jni.AnyAddress
import wallet.core.jni.CoinType
import wallet.core.jni.CoinType.BLUZELLE
import wallet.core.jni.PrivateKey
import wallet.core.jni.proto.Cosmos
Expand All @@ -29,7 +30,7 @@ class TestBluzelleSigner {

// Submitted Realworld tx for the following test : https://bigdipper.net.bluzelle.com/transactions/B3A7F30539CCDF72D210BC995FAF65B43F9BE04FA9F8AFAE0EC969660744002F
val key =
PrivateKey("80e81ea269e66a0a05b11236df7919fb7fbeedba87452d667489d7403a02f005".toHexByteArray())
PrivateKey("80e81ea269e66a0a05b11236df7919fb7fbeedba87452d667489d7403a02f005".toHexByteArray(), CoinType.BLUZELLE.curve())
val publicKey = key.getPublicKeySecp256k1(true)
val from = AnyAddress(publicKey, BLUZELLE).description()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestCardanoAddress {

@Test
fun testAddress() {
val key = PrivateKey("b0884d248cb301edd1b34cf626ba6d880bb3ae8fd91b4696446999dc4f0b5744309941d56938e943980d11643c535e046653ca6f498c014b88f2ad9fd6e71effbf36a8fa9f5e11eb7a852c41e185e3969d518e66e6893c81d3fc7227009952d4639aadd8b6499ae39b78018b79255fbd8f585cbda9cbb9e907a72af86afb7a05d41a57c2dec9a6a19d6bf3b1fa784f334f3a0048d25ccb7b78a7b44066f9ba7bed7f28be986cbe06819165f2ee41b403678a098961013cf4a2f3e9ea61fb6c1a".toHexByteArray())
val key = PrivateKey("b0884d248cb301edd1b34cf626ba6d880bb3ae8fd91b4696446999dc4f0b5744309941d56938e943980d11643c535e046653ca6f498c014b88f2ad9fd6e71effbf36a8fa9f5e11eb7a852c41e185e3969d518e66e6893c81d3fc7227009952d4639aadd8b6499ae39b78018b79255fbd8f585cbda9cbb9e907a72af86afb7a05d41a57c2dec9a6a19d6bf3b1fa784f334f3a0048d25ccb7b78a7b44066f9ba7bed7f28be986cbe06819165f2ee41b403678a098961013cf4a2f3e9ea61fb6c1a".toHexByteArray(), CoinType.CARDANO.curve())
val pubkey = key.publicKeyEd25519Cardano
val address = AnyAddress(pubkey, CoinType.CARDANO)
val expected = AnyAddress("addr1qx4z6twzknkkux0hhp0kq6hvdfutczp56g56y5em8r8mgvxalp7nkkk25vuspleke2zltaetmlwrfxv7t049cq9jmwjswmfw6t", CoinType.CARDANO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TestCardanoSigning {
/// https://cardanoscan.io/transaction/0203ce2c91f59f169a26e9ef91254639d2b7911afac9c7c0ae64539f88ba46a5
@Test
fun testSignTransferFromLegacy() {
val privateKey = PrivateKey("98f266d1aac660179bc2f456033941238ee6b2beb8ed0f9f34c9902816781f5a9903d1d395d6ab887b65ea5e344ef09b449507c21a75f0ce8c59d0ed1c6764eba7f484aa383806735c46fd769c679ee41f8952952036a6e2338ada940b8a91f4e890ca4eb6bec44bf751b5a843174534af64d6ad1f44e0613db78a7018781f5aa151d2997f52059466b715d8eefab30a78b874ae6ef4931fa58bb21ef8ce2423d46f19d0fbf75afb0b9a24e31d533f4fd74cee3b56e162568e8defe37123afc4".toHexByteArray())
val privateKey = PrivateKey("98f266d1aac660179bc2f456033941238ee6b2beb8ed0f9f34c9902816781f5a9903d1d395d6ab887b65ea5e344ef09b449507c21a75f0ce8c59d0ed1c6764eba7f484aa383806735c46fd769c679ee41f8952952036a6e2338ada940b8a91f4e890ca4eb6bec44bf751b5a843174534af64d6ad1f44e0613db78a7018781f5aa151d2997f52059466b715d8eefab30a78b874ae6ef4931fa58bb21ef8ce2423d46f19d0fbf75afb0b9a24e31d533f4fd74cee3b56e162568e8defe37123afc4".toHexByteArray(), CoinType.CARDANO.curve())
var publicKey = privateKey.publicKeyEd25519Cardano
var byronAddress = wallet.core.jni.Cardano.getByronAddress(publicKey)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TestConfluxeSpaceAddress {

@Test
fun testAddress() {
val key = PrivateKey("828c4c48c2cef521f0251920891ed79e871faa24f64f43cde83d07bc99f8dbf0".toHexByteArray())
val key = PrivateKey("828c4c48c2cef521f0251920891ed79e871faa24f64f43cde83d07bc99f8dbf0".toHexByteArray(), CoinType.CONFLUXESPACE.curve())
val pubkey = key.getPublicKeySecp256k1(false)
val address = AnyAddress(pubkey, CoinType.CONFLUXESPACE)
val expected = AnyAddress("0xe32DC46bfBF78D1eada7b0a68C96903e01418D64", CoinType.CONFLUXESPACE)
Expand Down
Loading
Loading