Skip to content

Commit

Permalink
[registry]: Set "OP Mainnet" for Optimism, "BTC" for Merlin display n…
Browse files Browse the repository at this point in the history
…ames (#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
  • Loading branch information
satoshiotomakan authored Apr 2, 2024
1 parent e56488f commit e82fa08
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ This list is generated from [./registry.json](../registry.json)
| 2301 | Qtum | QTUM | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/qtum/info/logo.png" width="32" /> | <https://qtum.org> |
| 2718 | Nebulas | NAS | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/nebulas/info/logo.png" width="32" /> | <https://nebulas.io> |
| 3030 | Hedera | HBAR | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/hedera/info/logo.png" width="32" /> | <https://hedera.com/> |
| 4200 | Merlin | ETH | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/merlin/info/logo.png" width="32" /> | <https://merlinchain.io> |
| 4200 | Merlin | BTC | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/merlin/info/logo.png" width="32" /> | <https://merlinchain.io> |
| 5000 | Mantle | MNT | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/mantle/info/logo.png" width="32" /> | <https://www.mantle.xyz> |
| 5600 | BNB Greenfield | BNB | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/greenfield/info/logo.png" width="32" /> | <https://greenfield.bnbchain.org> |
| 6060 | GoChain | GO | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/gochain/info/logo.png" width="32" /> | <https://gochain.io> |
Expand All @@ -105,7 +105,7 @@ This list is generated from [./registry.json](../registry.json)
| 5741564 | Waves | WAVES | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/waves/info/logo.png" width="32" /> | <https://wavesplatform.com> |
| 10000025 | Cronos Chain | CRO | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/cronos/info/logo.png" width="32" /> | <https://cronos.org> |
| 10000060 | Native Injective | INJ | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/nativeinjective/info/logo.png" width="32" /> | <https://injective.com> |
| 10000070 | Optimism Ethereum | ETH | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/info/logo.png" width="32" /> | <https://optimism.io/> |
| 10000070 | OP Mainnet | ETH | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/optimism/info/logo.png" width="32" /> | <https://optimism.io/> |
| 10000100 | Gnosis Chain | xDAI | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/xdai/info/logo.png" width="32" /> | <https://www.xdaichain.com> |
| 10000118 | Osmosis | OSMO | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/osmosis/info/logo.png" width="32" /> | <https://osmosis.zone/> |
| 10000145 | Smart Bitcoin Cash | BCH | <img src="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartbch/info/logo.png" width="32" /> | <https://smartbch.org/> |
Expand Down
4 changes: 2 additions & 2 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -3198,7 +3198,7 @@
{
"id": "optimism",
"name": "Optimism",
"displayName": "Optimism Ethereum",
"displayName": "OP Mainnet",
"coinId": 10000070,
"slip44": 60,
"symbol": "ETH",
Expand Down Expand Up @@ -4633,7 +4633,7 @@
"id": "merlin",
"name": "Merlin",
"coinId": 4200,
"symbol": "ETH",
"symbol": "BTC",
"decimals": 18,
"blockchain": "Ethereum",
"derivation": [
Expand Down
2 changes: 1 addition & 1 deletion tests/chains/Merlin/TWCoinTypeTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/chains/Optimism/TWCoinTypeTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
38 changes: 19 additions & 19 deletions tests/common/WalletConsoleTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -127,31 +127,31 @@ 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);
EXPECT_TRUE(res1.find("035431222ba2639ea442969c280a6965374bdd092ff9daf119460806abb093c93c") != string::npos);
}

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);
EXPECT_TRUE(res1.find("rror: Invalid private key data") != string::npos);
}

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);
EXPECT_TRUE(res1.find("Not yet implemented! :)") != string::npos);
}

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);
Expand All @@ -160,15 +160,15 @@ 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);
EXPECT_TRUE(res.find("nvalid public key data") != string::npos);
}

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);
Expand All @@ -177,15 +177,15 @@ 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);
EXPECT_TRUE(res1.find("nvalid private key data") != string::npos);
}

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);
Expand All @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand All @@ -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");
Expand Down

0 comments on commit e82fa08

Please sign in to comment.