From e82fa08bf3e52b096af05ccd4f0647caacbfbd0a Mon Sep 17 00:00:00 2001
From: satoshiotomakan <127754187+satoshiotomakan@users.noreply.github.com>
Date: Tue, 2 Apr 2024 10:40:58 +0200
Subject: [PATCH] [registry]: Set "OP Mainnet" for Optimism, "BTC" for Merlin
display names (#3763)
* feat(optimism): Change "Optimism Ethereum" display name to "OP Mainnet"
* feat(merlin): Change symbol from ETH to BTC
* feat(merlin): Change symbol from ETH to BTC
* Revert changes for Ethereum mainnet
* feat(merlin): Fix WalletConsole tests
* Update registry.md
---
docs/registry.md | 4 +--
registry.json | 4 +--
tests/chains/Merlin/TWCoinTypeTests.cpp | 2 +-
tests/chains/Optimism/TWCoinTypeTests.cpp | 2 +-
tests/common/WalletConsoleTests.cpp | 38 +++++++++++------------
5 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/docs/registry.md b/docs/registry.md
index 8d053718316..4079dd81817 100644
--- a/docs/registry.md
+++ b/docs/registry.md
@@ -87,7 +87,7 @@ This list is generated from [./registry.json](../registry.json)
| 2301 | Qtum | QTUM | | |
| 2718 | Nebulas | NAS | | |
| 3030 | Hedera | HBAR | | |
-| 4200 | Merlin | ETH | | |
+| 4200 | Merlin | BTC | | |
| 5000 | Mantle | MNT | | |
| 5600 | BNB Greenfield | BNB | | |
| 6060 | GoChain | GO | | |
@@ -105,7 +105,7 @@ This list is generated from [./registry.json](../registry.json)
| 5741564 | Waves | WAVES | | |
| 10000025 | Cronos Chain | CRO | | |
| 10000060 | Native Injective | INJ | | |
-| 10000070 | Optimism Ethereum | ETH | | |
+| 10000070 | OP Mainnet | ETH | | |
| 10000100 | Gnosis Chain | xDAI | | |
| 10000118 | Osmosis | OSMO | | |
| 10000145 | Smart Bitcoin Cash | BCH | | |
diff --git a/registry.json b/registry.json
index 15717d5b5b4..2f058c965a0 100644
--- a/registry.json
+++ b/registry.json
@@ -3198,7 +3198,7 @@
{
"id": "optimism",
"name": "Optimism",
- "displayName": "Optimism Ethereum",
+ "displayName": "OP Mainnet",
"coinId": 10000070,
"slip44": 60,
"symbol": "ETH",
@@ -4633,7 +4633,7 @@
"id": "merlin",
"name": "Merlin",
"coinId": 4200,
- "symbol": "ETH",
+ "symbol": "BTC",
"decimals": 18,
"blockchain": "Ethereum",
"derivation": [
diff --git a/tests/chains/Merlin/TWCoinTypeTests.cpp b/tests/chains/Merlin/TWCoinTypeTests.cpp
index 4f045742865..c50d7b185bb 100644
--- a/tests/chains/Merlin/TWCoinTypeTests.cpp
+++ b/tests/chains/Merlin/TWCoinTypeTests.cpp
@@ -18,7 +18,7 @@ TEST(TWMerlinCoinType, TWCoinType) {
assertStringsEqual(id, "merlin");
assertStringsEqual(name, "Merlin");
- assertStringsEqual(symbol, "ETH");
+ assertStringsEqual(symbol, "BTC");
ASSERT_EQ(TWCoinTypeConfigurationGetDecimals(coin), 18);
ASSERT_EQ(TWCoinTypeBlockchain(coin), TWBlockchainEthereum);
ASSERT_EQ(TWCoinTypeP2pkhPrefix(coin), 0);
diff --git a/tests/chains/Optimism/TWCoinTypeTests.cpp b/tests/chains/Optimism/TWCoinTypeTests.cpp
index 9e51cffa575..97be122198d 100644
--- a/tests/chains/Optimism/TWCoinTypeTests.cpp
+++ b/tests/chains/Optimism/TWCoinTypeTests.cpp
@@ -26,5 +26,5 @@ TEST(TWOptimismCoinType, TWCoinType) {
assertStringsEqual(txUrl, "https://optimistic.etherscan.io/tx/0x6fd99288be9bf71eb002bb31da10a4fb0fbbb3c45ae73693b212f49c9db7df8f");
assertStringsEqual(accUrl, "https://optimistic.etherscan.io/address/0x1f932361e31d206b4f6b2478123a9d0f8c761031");
assertStringsEqual(id, "optimism");
- assertStringsEqual(name, "Optimism Ethereum");
+ assertStringsEqual(name, "OP Mainnet");
}
diff --git a/tests/common/WalletConsoleTests.cpp b/tests/common/WalletConsoleTests.cpp
index 7ac70b0c654..3ad84cb5f2c 100644
--- a/tests/common/WalletConsoleTests.cpp
+++ b/tests/common/WalletConsoleTests.cpp
@@ -84,27 +84,27 @@ TEST(WalletConsole, coins) {
TEST(WalletConsole, coin) {
{
auto pos = outputss.str().length();
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin atom");
string res = outputss.str().substr(pos);
- EXPECT_TRUE(res.find("Set active coin to: bitcoin") != string::npos);
+ EXPECT_TRUE(res.find("Set active coin to: cosmos") != string::npos);
}
{
auto pos = outputss.str().length();
cmd.executeLine("coin ethereum");
string res = outputss.str().substr(pos);
- EXPECT_TRUE(res.find("Set active coin to: ethereum") != string::npos);
+ EXPECT_TRUE(res.find("Set active coin to: ethereum") != string::npos) << res;
}
{
auto pos = outputss.str().length();
cmd.executeLine("coin bitcoin");
string res = outputss.str().substr(pos);
- EXPECT_TRUE(res.find("Set active coin to: bitcoin") != string::npos);
+ EXPECT_TRUE(res.find("Set active coin to: bitcoin") != string::npos) << res;
}
{
auto pos = outputss.str().length();
cmd.executeLine("coin no_such_coin_exists");
string res = outputss.str().substr(pos);
- EXPECT_TRUE(res.find("Error: No such coin") != string::npos);
+ EXPECT_TRUE(res.find("Error: No such coin") != string::npos) << res;
}
}
@@ -127,7 +127,7 @@ TEST(WalletConsole, newkey1) {
}
TEST(WalletConsole, pubPri1) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("pubPri 7d40d6a74e98543f545852989d54712834f9c86eddee89303a2083219749e38c");
string res1 = outputss.str().substr(pos1);
@@ -135,7 +135,7 @@ TEST(WalletConsole, pubPri1) {
}
TEST(WalletConsole, pubPriInvalid) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("pubPri Hello!_This_is_an_invalid_private_key");
string res1 = outputss.str().substr(pos1);
@@ -143,7 +143,7 @@ TEST(WalletConsole, pubPriInvalid) {
}
TEST(WalletConsole, priPub) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("priPub 0200266ab7dc3efec040cc8b9714ff49cc8339d2f30d9bab8a4b11043e1bdfee37");
string res1 = outputss.str().substr(pos1);
@@ -151,7 +151,7 @@ TEST(WalletConsole, priPub) {
}
TEST(WalletConsole, addrPubBtc1) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos0 = outputss.str().length();
cmd.executeLine("addrPub 0200266ab7dc3efec040cc8b9714ff49cc8339d2f30d9bab8a4b11043e1bdfee37");
string res = outputss.str().substr(pos0);
@@ -160,7 +160,7 @@ TEST(WalletConsole, addrPubBtc1) {
}
TEST(WalletConsole, addrPubInvalid) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos0 = outputss.str().length();
cmd.executeLine("addrPub Hello!");
string res = outputss.str().substr(pos0);
@@ -168,7 +168,7 @@ TEST(WalletConsole, addrPubInvalid) {
}
TEST(WalletConsole, addrPri1) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("addrPri 7d40d6a74e98543f545852989d54712834f9c86eddee89303a2083219749e38c");
string res1 = outputss.str().substr(pos1);
@@ -177,7 +177,7 @@ TEST(WalletConsole, addrPri1) {
}
TEST(WalletConsole, addrPriInvalid) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("addrPri Hello!");
string res1 = outputss.str().substr(pos1);
@@ -185,7 +185,7 @@ TEST(WalletConsole, addrPriInvalid) {
}
TEST(WalletConsole, addrInvalid) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("addr Hello_This_is_an_Invalid_BTC_Address!_");
string res1 = outputss.str().substr(pos1);
@@ -194,7 +194,7 @@ TEST(WalletConsole, addrInvalid) {
TEST(WalletConsole, addrDP1) {
cmd.executeLine("setMnemonic " + mnemonic1);
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
// default DP
auto pos1 = outputss.str().length();
@@ -263,7 +263,7 @@ TEST(WalletConsole, newMnemonic) {
TEST(WalletConsole, dumpdp) {
{
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("dumpDP");
string res1 = outputss.str().substr(pos1);
@@ -286,7 +286,7 @@ TEST(WalletConsole, dumpdp) {
}
TEST(WalletConsole, dumpXpub) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("setMnemonic " + mnemonic1);
string res1 = outputss.str().substr(pos1);
@@ -301,7 +301,7 @@ TEST(WalletConsole, dumpXpub) {
TEST(WalletConsole, derive) {
// Step-by-step derivation, mnemo -> pri -> pub -> addr
cmd.executeLine("setMnemonic " + mnemonic1);
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
{
auto pos1 = outputss.str().length();
cmd.executeLine("priDP m/84'/0'/0'/0/1");
@@ -334,7 +334,7 @@ TEST(WalletConsole, derive) {
TEST(WalletConsole, addrDefault) {
{
cmd.executeLine("setMnemonic " + mnemonic1);
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
auto pos1 = outputss.str().length();
cmd.executeLine("addrDefault");
string res1 = outputss.str().substr(pos1);
@@ -357,7 +357,7 @@ TEST(WalletConsole, addrDefault) {
}
TEST(WalletConsole, addrXpub) {
- cmd.executeLine("coin btc");
+ cmd.executeLine("coin bitcoin");
// no need to set mnemonic here
auto pos1 = outputss.str().length();
cmd.executeLine("addrXpub zpub6qvN3x2m4Q96SJJ8Q3ZRbCTm4mGdTny6u2hY8tTiyWznnjwc3rRYpHDb1gN9AAypB5m2x1WR954CLNqpLcAxkxt9x7LX9hKDGp9sGtZca7o 0");