From fc2ceb0ce3a80aaa62f1c1735ca706cd77e27f3a Mon Sep 17 00:00:00 2001 From: Sergei Boiko <127754187+satoshiotomakan@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:23:32 +0700 Subject: [PATCH] revert(heco): Revert Huobi ECO delisting (#4254) * Revert "delete(heco): Delete Huobi ECO Chain (#4244)" This reverts commit 78b053643056ab86529ad5b5bfa0f9f7c4a9b461. * chore(gradle): Update grade to 8.10.2 on CI * [CI] Trigger CI * chore(pod): Update COCOAPODS to 1.14.3 --- .../blockchains/CoinAddressDerivationTests.kt | 2 +- docs/registry.md | 1 + include/TrustWalletCore/TWCoinType.h | 1 + .../core/test/CoinAddressDerivationTests.kt | 2 +- registry.json | 31 +++++++++++++++++++ .../tests/coin_address_derivation_test.rs | 1 + swift/Tests/CoinAddressDerivationTests.swift | 1 + tests/chains/ECO/TWCoinTypeTests.cpp | 28 +++++++++++++++++ tests/common/CoinAddressDerivationTests.cpp | 1 + 9 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 tests/chains/ECO/TWCoinTypeTests.cpp 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 2a192014a1a..94adc9f0ad5 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 @@ -43,7 +43,7 @@ class CoinAddressDerivationTests { DASH -> assertEquals("XqHiz8EXYbTAtBEYs4pWTHh7ipEDQcNQeT", address) DIGIBYTE -> assertEquals("dgb1qtjgmerfqwdffyf8ghcrkgy52cghsqptynmyswu", address) - ETHEREUM, SMARTCHAIN, POLYGON, OPTIMISM, ZKSYNC, ARBITRUM, ARBITRUMNOVA, AVALANCHECCHAIN, XDAI, + ETHEREUM, SMARTCHAIN, POLYGON, OPTIMISM, ZKSYNC, ARBITRUM, ARBITRUMNOVA, ECOCHAIN, AVALANCHECCHAIN, XDAI, FANTOM, CELO, CRONOSCHAIN, SMARTBITCOINCASH, KUCOINCOMMUNITYCHAIN, BOBA, METIS, AURORA, EVMOS, MOONRIVER, MOONBEAM, KAVAEVM, KAIA, METER, OKXCHAIN, POLYGONZKEVM, SCROLL, CONFLUXESPACE, ACALAEVM, OPBNB, NEON, BASE, LINEA, GREENFIELD, MANTLE, ZENEON, MANTAPACIFIC, diff --git a/docs/registry.md b/docs/registry.md index b60592edf00..2c0bce5d0bc 100644 --- a/docs/registry.md +++ b/docs/registry.md @@ -120,6 +120,7 @@ This list is generated from [./registry.json](../registry.json) | 10000321 | KuCoin Community Chain | KCS | | | | 10000324 | zkSync Era | ETH | | | | 10000330 | Terra | LUNA | | | +| 10000553 | Huobi ECO Chain | HT | | | | 10000787 | Acala EVM | ACA | | | | 10000990 | Coreum | CORE | | | | 10001088 | Metis | METIS | | | diff --git a/include/TrustWalletCore/TWCoinType.h b/include/TrustWalletCore/TWCoinType.h index 285e4d23491..da009c8f1ff 100644 --- a/include/TrustWalletCore/TWCoinType.h +++ b/include/TrustWalletCore/TWCoinType.h @@ -100,6 +100,7 @@ enum TWCoinType { TWCoinTypeOptimism = 10000070, TWCoinTypeZksync = 10000324, TWCoinTypeArbitrum = 10042221, + TWCoinTypeECOChain = 10000553, TWCoinTypeAvalancheCChain = 10009000, TWCoinTypeXDai = 10000100, TWCoinTypeFantom = 10000250, diff --git a/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt b/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt index c0dc0aa4b32..77417a3bc42 100644 --- a/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt +++ b/kotlin/wallet-core-kotlin/src/commonTest/kotlin/com/trustwallet/core/test/CoinAddressDerivationTests.kt @@ -36,7 +36,7 @@ class CoinAddressDerivationTests { Dash -> "XqHiz8EXYbTAtBEYs4pWTHh7ipEDQcNQeT" DigiByte -> "dgb1qtjgmerfqwdffyf8ghcrkgy52cghsqptynmyswu" - Ethereum, SmartChain, Polygon, Optimism, Zksync, Arbitrum, ArbitrumNova, AvalancheCChain, XDai, + Ethereum, SmartChain, Polygon, Optimism, Zksync, Arbitrum, ArbitrumNova, ECOChain, AvalancheCChain, XDai, Fantom, Celo, CronosChain, SmartBitcoinCash, KuCoinCommunityChain, Boba, Metis, Aurora, Evmos, Moonriver, Moonbeam, KavaEvm, Kaia, Meter, OKXChain, PolygonzkEVM, Scroll, ConfluxeSpace, AcalaEVM, OpBNB, Neon, Base, Linea, Greenfield, Mantle, ZenEON, MantaPacific, diff --git a/registry.json b/registry.json index 59f0db165a3..c4815092bb7 100644 --- a/registry.json +++ b/registry.json @@ -3387,6 +3387,37 @@ "documentation": "https://docs.arbitrum.io/" } }, + { + "id": "heco", + "name": "ECO Chain", + "displayName": "Huobi ECO Chain", + "coinId": 10000553, + "slip44": 553, + "symbol": "HT", + "decimals": 18, + "blockchain": "Ethereum", + "derivation": [ + { + "path": "m/44'/60'/0'/0/0" + } + ], + "curve": "secp256k1", + "publicKeyType": "secp256k1Extended", + "chainId": "128", + "addressHasher": "keccak256", + "explorer": { + "url": "https://hecoinfo.com", + "txPath": "/tx/", + "accountPath": "/address/" + }, + "info": { + "url": "https://www.hecochain.com/en-us", + "source": "https://github.com/HuobiGroup/huobi-eco-chain", + "rpc": "https://http-mainnet-node.huobichain.com", + "documentation": "https://eth.wiki/json-rpc/API" + }, + "testFolderName": "ECO" + }, { "id": "avalanchec", "name": "Avalanche C-Chain", diff --git a/rust/tw_tests/tests/coin_address_derivation_test.rs b/rust/tw_tests/tests/coin_address_derivation_test.rs index 6dc4776f2ac..44725a3d910 100644 --- a/rust/tw_tests/tests/coin_address_derivation_test.rs +++ b/rust/tw_tests/tests/coin_address_derivation_test.rs @@ -47,6 +47,7 @@ fn test_coin_address_derivation() { | CoinType::Celo | CoinType::ConfluxeSpace | CoinType::CronosChain + | CoinType::ECOChain | CoinType::EthereumClassic | CoinType::Evmos | CoinType::Fantom diff --git a/swift/Tests/CoinAddressDerivationTests.swift b/swift/Tests/CoinAddressDerivationTests.swift index e684aa2cb34..24631acb24a 100644 --- a/swift/Tests/CoinAddressDerivationTests.swift +++ b/swift/Tests/CoinAddressDerivationTests.swift @@ -86,6 +86,7 @@ class CoinAddressDerivationTests: XCTestCase { .scroll, .arbitrum, .arbitrumNova, + .ecochain, .avalancheCChain, .xdai, .fantom, diff --git a/tests/chains/ECO/TWCoinTypeTests.cpp b/tests/chains/ECO/TWCoinTypeTests.cpp new file mode 100644 index 00000000000..c982259660f --- /dev/null +++ b/tests/chains/ECO/TWCoinTypeTests.cpp @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright © 2017 Trust Wallet. +// + +#include "TestUtilities.h" +#include +#include + + +TEST(TWHECOCoinType, TWCoinType) { + auto symbol = WRAPS(TWCoinTypeConfigurationGetSymbol(TWCoinTypeECOChain)); + auto txId = WRAPS(TWStringCreateWithUTF8Bytes("0x2e62832615f5b68b3bbcd72046a24260ce47052841c1679841b9c574d3959f13")); + auto txUrl = WRAPS(TWCoinTypeConfigurationGetTransactionURL(TWCoinTypeECOChain, txId.get())); + auto accId = WRAPS(TWStringCreateWithUTF8Bytes("0xc5a5b3e49e5d06afe163553c942dc59b4e358cf1")); + auto accUrl = WRAPS(TWCoinTypeConfigurationGetAccountURL(TWCoinTypeECOChain, accId.get())); + auto id = WRAPS(TWCoinTypeConfigurationGetID(TWCoinTypeECOChain)); + auto name = WRAPS(TWCoinTypeConfigurationGetName(TWCoinTypeECOChain)); + + ASSERT_EQ(TWCoinTypeConfigurationGetDecimals(TWCoinTypeECOChain), 18); + ASSERT_EQ(TWBlockchainEthereum, TWCoinTypeBlockchain(TWCoinTypeECOChain)); + + assertStringsEqual(symbol, "HT"); + assertStringsEqual(txUrl, "https://hecoinfo.com/tx/0x2e62832615f5b68b3bbcd72046a24260ce47052841c1679841b9c574d3959f13"); + assertStringsEqual(accUrl, "https://hecoinfo.com/address/0xc5a5b3e49e5d06afe163553c942dc59b4e358cf1"); + assertStringsEqual(id, "heco"); + assertStringsEqual(name, "Huobi ECO Chain"); +} diff --git a/tests/common/CoinAddressDerivationTests.cpp b/tests/common/CoinAddressDerivationTests.cpp index 53e3c7b8a5b..c537a8d8f90 100644 --- a/tests/common/CoinAddressDerivationTests.cpp +++ b/tests/common/CoinAddressDerivationTests.cpp @@ -45,6 +45,7 @@ TEST(Coin, DeriveAddress) { case TWCoinTypeCelo: case TWCoinTypeConfluxeSpace: case TWCoinTypeCronosChain: + case TWCoinTypeECOChain: case TWCoinTypeEthereumClassic: case TWCoinTypeEvmos: case TWCoinTypeFantom: