Skip to content

Commit

Permalink
Merge branch 'rm-goerli'
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Oct 18, 2024
2 parents 75ed316 + ee55066 commit fa8b3c4
Show file tree
Hide file tree
Showing 19 changed files with 15 additions and 42 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased
- Android: enable export logs feature
- Label UTXOs that were created as change, as such, in coin control
- Remove support for deprecated the Ethereum Goerli network

# 4.45.0
- Bundle BitBox02 firmware version v9.21.0
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ Get Bitcoin Testnet coins here: https://coinfaucet.eu/en/btc-testnet/

Get Litecoin Testnet coins here: https://tltc.bitaps.com/

Get Ethereum Goerli coins here: https://goerlifaucet.com/

Get Ethereum Sepolia coins here: https://faucet.sepolia.dev/

In case any of the Ethereum faucets are not working, you can try others from here: https://faucetlink.to (some require account creation)
10 changes: 4 additions & 6 deletions backend/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ func sortAccounts(accounts []accounts.Interface) {
switch ethCoin.ChainID() {
case params.MainnetChainConfig.ChainID.Uint64():
return 4, true
case params.GoerliChainConfig.ChainID.Uint64():
return 5, true
case params.SepoliaChainConfig.ChainID.Uint64():
return 6, true
return 5, true
}
}
return 0, false
Expand Down Expand Up @@ -204,7 +202,7 @@ func (backend *Backend) SupportedCoins(keystore keystore.Keystore) []coinpkg.Cod
allCoins := []coinpkg.Code{
coinpkg.CodeBTC, coinpkg.CodeTBTC, coinpkg.CodeRBTC,
coinpkg.CodeLTC, coinpkg.CodeTLTC,
coinpkg.CodeETH, coinpkg.CodeGOETH, coinpkg.CodeSEPETH,
coinpkg.CodeETH, coinpkg.CodeSEPETH,
}
var availableCoins []coinpkg.Code
for _, coinCode := range allCoins {
Expand Down Expand Up @@ -467,7 +465,7 @@ func (backend *Backend) createAndPersistAccountConfig(
},
accountsConfig,
)
case coinpkg.CodeETH, coinpkg.CodeGOETH, coinpkg.CodeSEPETH:
case coinpkg.CodeETH, coinpkg.CodeSEPETH:
bip44Coin := "1'"
if coinCode == coinpkg.CodeETH {
bip44Coin = "60'"
Expand Down Expand Up @@ -1208,7 +1206,7 @@ func (backend *Backend) persistDefaultAccountConfigs(keystore keystore.Keystore,
}
}
} else {
for _, coinCode := range []coinpkg.Code{coinpkg.CodeTBTC, coinpkg.CodeTLTC, coinpkg.CodeGOETH, coinpkg.CodeSEPETH} {
for _, coinCode := range []coinpkg.Code{coinpkg.CodeTBTC, coinpkg.CodeTLTC, coinpkg.CodeSEPETH} {
if backend.config.AppConfig().Backend.DeprecatedCoinActive(coinCode) {
if _, err := backend.createAndPersistAccountConfig(
coinCode, 0, false, "", keystore, nil, accountsConfig); err != nil {
Expand Down
4 changes: 1 addition & 3 deletions backend/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ func TestSortAccounts(t *testing.T) {
{Code: "acct-btc-1", CoinCode: coinpkg.CodeBTC, SigningConfigurations: btcConfig("m/84'/0'/0'")},
{Code: "acct-btc-3", CoinCode: coinpkg.CodeBTC, SigningConfigurations: btcConfig("m/84'/0'/2'")},
{Code: "acct-btc-2", CoinCode: coinpkg.CodeBTC, SigningConfigurations: btcConfig("m/84'/0'/1'")},
{Code: "acct-goeth", CoinCode: coinpkg.CodeGOETH},
{Code: "acct-sepeth", CoinCode: coinpkg.CodeSEPETH},
{Code: "acct-ltc", CoinCode: coinpkg.CodeLTC},
{Code: "acct-tltc", CoinCode: coinpkg.CodeTLTC},
Expand All @@ -195,7 +194,6 @@ func TestSortAccounts(t *testing.T) {
"acct-eth-2",
"acct-eth-2-eth-erc20-bat",
"acct-eth-2-eth-erc20-usdt",
"acct-goeth",
"acct-sepeth",
}

Expand Down Expand Up @@ -312,7 +310,7 @@ func TestSupportedCoins(t *testing.T) {
b := newBackend(t, testnetEnabled, regtestDisabled)
defer b.Close()
require.Equal(t,
[]coinpkg.Code{coinpkg.CodeTBTC, coinpkg.CodeTLTC, coinpkg.CodeGOETH, coinpkg.CodeSEPETH},
[]coinpkg.Code{coinpkg.CodeTBTC, coinpkg.CodeTLTC, coinpkg.CodeSEPETH},
b.SupportedCoins(&keystoremock.KeystoreMock{
SupportsCoinFunc: func(coin coinpkg.Coin) bool {
return true
Expand Down
7 changes: 0 additions & 7 deletions backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ var fixedURLWhitelist = []string{
"https://sochain.com/tx/LTCTEST/",
"https://blockchair.com/litecoin/transaction/",
"https://etherscan.io/tx/",
"https://goerli.etherscan.io/tx/",
"https://sepolia.etherscan.io/tx/",
// Moonpay onramp
"https://www.moonpay.com/",
Expand Down Expand Up @@ -511,12 +510,6 @@ func (backend *Backend) Coin(code coinpkg.Code) (coinpkg.Coin, error) {
"https://etherscan.io/tx/",
etherScan,
nil)
case code == coinpkg.CodeGOETH:
etherScan := etherscan.NewEtherScan("https://api-goerli.etherscan.io/api", backend.etherScanHTTPClient)
coin = eth.NewCoin(etherScan, code, "Ethereum Goerli", "GOETH", "GOETH", params.GoerliChainConfig,
"https://goerli.etherscan.io/tx/",
etherScan,
nil)
case code == coinpkg.CodeSEPETH:
etherScan := etherscan.NewEtherScan("https://api-sepolia.etherscan.io/api", backend.etherScanHTTPClient)
coin = eth.NewCoin(etherScan, code, "Ethereum Sepolia", "SEPETH", "SEPETH", params.SepoliaChainConfig,
Expand Down
1 change: 0 additions & 1 deletion backend/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ func newBackend(t *testing.T, testing, regtest bool) *Backend {
// avoid hitting real API for ETH coins.
for _, code := range []coinpkg.Code{
coinpkg.CodeETH,
coinpkg.CodeGOETH,
coinpkg.CodeSEPETH,
} {
c, err := b.Coin(code)
Expand Down
3 changes: 0 additions & 3 deletions backend/coins/coin/codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const (
CodeTLTC Code = "tltc"
// CodeETH is Ethereum.
CodeETH Code = "eth"
// CodeGOETH is Ethereum Goerli.
CodeGOETH Code = "goeth"
// CodeSEPETH is Ethereum Sepolia.
CodeSEPETH Code = "sepeth"
// If you add coins, don't forget to update `testnetCoins` below.
Expand All @@ -53,6 +51,5 @@ const (
var TestnetCoins = map[Code]struct{}{
CodeTBTC: {},
CodeTLTC: {},
CodeGOETH: {},
CodeSEPETH: {},
}
2 changes: 1 addition & 1 deletion backend/coins/eth/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func newAccount(t *testing.T) *Account {
return 0, nil
},
}
coin := NewCoin(client, coin.CodeGOETH, "Goerli", "GOETH", "GOETH", params.GoerliChainConfig, "", nil, nil)
coin := NewCoin(client, coin.CodeSEPETH, "Sepolia", "SEPETH", "SEPETH", params.SepoliaChainConfig, "", nil, nil)
acct := NewAccount(
&accounts.AccountConfig{
Config: &config.Account{
Expand Down
2 changes: 1 addition & 1 deletion backend/config/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestLookupByXpub(t *testing.T) {

func TestSetTokenActive(t *testing.T) {
// not an ETH account.
require.Error(t, (&Account{CoinCode: coin.CodeGOETH}).SetTokenActive("TOKEN", true))
require.Error(t, (&Account{CoinCode: coin.CodeSEPETH}).SetTokenActive("TOKEN", true))

acct := &Account{
CoinCode: coin.CodeETH,
Expand Down
2 changes: 1 addition & 1 deletion backend/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (backend Backend) DeprecatedCoinActive(code coin.Code) bool {
return backend.DeprecatedBitcoinActive
case coin.CodeLTC, coin.CodeTLTC:
return backend.DeprecatedLitecoinActive
case coin.CodeETH, coin.CodeGOETH, coin.CodeSEPETH:
case coin.CodeETH, coin.CodeSEPETH:
return backend.DeprecatedEthereumActive
default:
panic(fmt.Sprintf("unknown code %s", code))
Expand Down
2 changes: 0 additions & 2 deletions backend/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,6 @@ func (handlers *Handlers) getConvertFromFiat(r *http.Request) interface{} {
switch unit { // HACK: fake rates for testnet coins
case "TBTC", "TLTC":
unit = unit[1:]
case "GOETH":
unit = unit[2:]
case "SEPETH":
unit = unit[3:]
}
Expand Down
1 change: 0 additions & 1 deletion backend/rates/gecko.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ var (
"tbtc": "bitcoin",
"rbtc": "bitcoin",
"tltc": "litecoin",
"goeth": "ethereum",
"sepeth": "ethereum",
// ERC20 tokens as used in the backend.
// Frontend and app config use unprefixed name, without "eth-erc20-".
Expand Down
4 changes: 1 addition & 3 deletions backend/rates/rates.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,8 @@ func (updater *RateUpdater) updateLast(ctx context.Context) {
rates[SAT.String()] = sat

// Provide conversion rates for testnets as well, useful for testing.
for _, testnetUnit := range []string{"TBTC", "RBTC", "TLTC", "GOETH", "SEPETH"} {
for _, testnetUnit := range []string{"TBTC", "RBTC", "TLTC", "SEPETH"} {
switch testnetUnit {
case "GOETH":
rates[testnetUnit] = rates[testnetUnit[2:]]
case "SEPETH":
rates[testnetUnit] = rates[testnetUnit[3:]]
default:
Expand Down
4 changes: 2 additions & 2 deletions frontends/web/src/api/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import type { TDetailStatus } from './bitsurance';
import type { SuccessResponse } from './response';
import { Slip24 } from 'request-address';

export type NativeCoinCode = 'btc' | 'tbtc' | 'rbtc' | 'ltc' | 'tltc' | 'eth' | 'goeth' | 'sepeth';
export type NativeCoinCode = 'btc' | 'tbtc' | 'rbtc' | 'ltc' | 'tltc' | 'eth' | 'sepeth';

export type AccountCode = string;

export type Fiat = 'AUD' | 'BRL' | 'BTC' | 'CAD' | 'CHF' | 'CNY' | 'CZK' | 'EUR' | 'GBP' | 'HKD' | 'ILS' | 'JPY' | 'KRW' | 'NOK' | 'PLN' | 'RUB' | 'sat' | 'SEK' | 'SGD' | 'USD';

export type ConversionUnit = Fiat | 'sat'

export type CoinUnit = 'BTC' | 'sat' | 'LTC' | 'ETH' | 'TBTC' | 'tsat' | 'TLTC' | 'GOETH' | 'SEPETH';
export type CoinUnit = 'BTC' | 'sat' | 'LTC' | 'ETH' | 'TBTC' | 'tsat' | 'TLTC' | 'SEPETH';

export type ERC20TokenUnit = 'USDT' | 'USDC' | 'LINK' | 'BAT' | 'MKR' | 'ZRX' | 'WBTC' | 'PAXG' | 'DAI';

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/amount/amount.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('Amount formatting', () => {
});

describe('non BTC coins amounts', () => {
let coins: CoinUnit[] = ['ETH', 'GOETH', 'SEPETH'];
let coins: CoinUnit[] = ['ETH', 'SEPETH'];
coins.forEach(coin => {
it('10.00000000 ' + coin + ' with removeBtcTrailingZeroes enabled stays 10.00000000', () => {
const { container } = render(<Amount amount="10.00000000" unit={coin} removeBtcTrailingZeroes/>);
Expand Down
1 change: 0 additions & 1 deletion frontends/web/src/components/icon/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const logoMap: LogoMap = {
'ltc': [LTC, LTC_GREY],
'tltc': [LTC, LTC_GREY],
'eth': [ETH, ETH_GREY],
'goeth': [ETH, ETH_GREY],
'sepeth': [ETH, ETH_GREY],
'erc20Test': [ETH, ETH_GREY],

Expand Down
3 changes: 1 addition & 2 deletions frontends/web/src/routes/account/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const isBitcoinBased = (coinCode: CoinCode): boolean => {
};

export const isEthereumBased = (coinCode: CoinCode): boolean => {
return coinCode === 'eth' || coinCode === 'goeth' || coinCode === 'sepeth' || coinCode.startsWith('eth-erc20-');
return coinCode === 'eth' || coinCode === 'sepeth' || coinCode.startsWith('eth-erc20-');
};

export const getCoinCode = (coinCode: CoinCode): CoinCode | undefined => {
Expand All @@ -61,7 +61,6 @@ export const getCoinCode = (coinCode: CoinCode): CoinCode | undefined => {
case 'tltc':
return 'ltc';
case 'eth':
case 'goeth':
case 'sepeth':
return 'eth';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const WCIncomingPairing = ({
if (e.message.includes('Non conforming namespaces')) {
alertUser(t('walletConnect.invalidPairingChain',
{
chains: '\n•Ethereum \n•Ethereum (Goerli)'
chains: '\n•Ethereum'
}));
} else {
//unexpected error, display native error message
Expand Down
4 changes: 0 additions & 4 deletions frontends/web/src/utils/walletconnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ export const SUPPORTED_CHAINS: TSupportedChainDetail = {
name: 'Etherum mainnet',
icon: createElement(ETHLogo)
},
'eip155:5': {
name: 'Ethereum goerli',
icon: createElement(ETHLogo)
},
};

export const EIP155_SIGNING_METHODS = {
Expand Down

0 comments on commit fa8b3c4

Please sign in to comment.