From ae0a05635a2995e4f01e4910fd56430ae194defb Mon Sep 17 00:00:00 2001 From: Andrei Bancioiu Date: Tue, 28 Apr 2020 12:10:52 +0000 Subject: [PATCH] Fix derivation path and tests --- .../core/app/blockchains/CoinAddressDerivationTests.kt | 2 +- coins.json | 2 +- swift/Tests/CoinAddressDerivationTests.swift | 2 +- tests/interface/TWHDWalletTests.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt b/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt index 810d8e30fc9..18ab0a98320 100644 --- a/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt +++ b/android/app/src/androidTest/java/com/trustwallet/core/app/blockchains/CoinAddressDerivationTests.kt @@ -83,6 +83,6 @@ class CoinAddressDerivationTests { CARDANO -> assertEquals("addr1snpa4z7ntyfszv7ckquprdw75w4qjqh0qmya9jtkpxxlzxghlqyvv7l0yjamh8fxraw06p3ua8sj2g2gv98v4849s43t9g2999kquuu5egnprk", address) NEO -> assertEquals("AT6w7PJvwPcSqHvtbNBY2aHPDv12eW5Uuf", address) FILECOIN -> assertEquals("f1zzykebxldfcakj5wdb5n3n7priul522fnmjzori", address) - ELROND -> assertEquals("erd1k3hzqq8yffrsr86238r3avwq6w0kfgtwrjwhf72n07kxyk4nzwxqvm47d2", address) + ELROND -> assertEquals("erd1jfcy8aeru6vlx4fe6h3pc3vlpe2cnnur5zetxdhp879yagq7vqvs8na4f8", address) } } diff --git a/coins.json b/coins.json index 9c309f1f57d..175ef086de3 100644 --- a/coins.json +++ b/coins.json @@ -1337,7 +1337,7 @@ "symbol": "ERD", "decimals": 18, "blockchain": "ElrondNetwork", - "derivationPath": "m/44'/508'/0'", + "derivationPath": "m/44'/508'/0'/0'/0'", "curve": "ed25519", "publicKeyType": "ed25519", "hrp": "erd", diff --git a/swift/Tests/CoinAddressDerivationTests.swift b/swift/Tests/CoinAddressDerivationTests.swift index b7dbcdaddbc..2a09ac50169 100644 --- a/swift/Tests/CoinAddressDerivationTests.swift +++ b/swift/Tests/CoinAddressDerivationTests.swift @@ -191,7 +191,7 @@ class CoinAddressDerivationTests: XCTestCase { let expectedResult = "f1zzykebxldfcakj5wdb5n3n7priul522fnmjzori" AssetCoinDerivation(coin, expectedResult, derivedAddress, address) case .elrond: - let expectedResult = "erd1k3hzqq8yffrsr86238r3avwq6w0kfgtwrjwhf72n07kxyk4nzwxqvm47d2" + let expectedResult = "erd1jfcy8aeru6vlx4fe6h3pc3vlpe2cnnur5zetxdhp879yagq7vqvs8na4f8" AssetCoinDerivation(coin, expectedResult, derivedAddress, address) @unknown default: fatalError() diff --git a/tests/interface/TWHDWalletTests.cpp b/tests/interface/TWHDWalletTests.cpp index df8deb258cd..6b286eee3cb 100644 --- a/tests/interface/TWHDWalletTests.cpp +++ b/tests/interface/TWHDWalletTests.cpp @@ -237,8 +237,8 @@ TEST(HDWallet, DeriveElrond) { auto privateKeyData = WRAPD(TWPrivateKeyData(privateKey.get())); auto address = WRAPS(TWCoinTypeDeriveAddress(TWCoinTypeElrond, privateKey.get())); - assertHexEqual(privateKeyData, "1e6a08a0dc7cfcafdeea72949c3f6c1f8828536727e4b3d64232609c41cb8b3e"); - assertStringsEqual(address, "erd17vh5dwqrvnlxpmgwujewkuqk0rs9wkl2sgmnxgcp8ahjap5suwusqkuc5r"); + assertHexEqual(privateKeyData, "0eb593141de897d60a0883320793eb49e63d556ccdf783a87ec014f150d50453"); + assertStringsEqual(address, "erd1a6l7q9cfvrgr80xuzm37tapdr4zm3mwrtl6vt8f45df45x7eadfs8ds5vv"); } TEST(HDWallet, ExtendedKeys) {