Skip to content

Commit c5cd85a

Browse files
committed
fix: combined cleanup (PRs keepkey#173, keepkey#175, keepkey#170, keepkey#165)
- Add WETH to uniswap token database (PR keepkey#173) - Guard Ethereum tests with requires_fullFeature for BTC-only firmware (PR keepkey#175) - Fix shebang lines: /bin/env -> /usr/bin/env (PR keepkey#170) - Add ripple_get_address command to keepkeyctl (PR keepkey#165)
1 parent f1dd2b6 commit c5cd85a

6 files changed

Lines changed: 23 additions & 3 deletions

File tree

keepkeyctl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ class Commands(object):
173173
script_type = typemap[args.script_type];
174174
return self.client.get_public_node(n=address_n, show_display=args.show_display, coin_name=args.coin, script_type=script_type).xpub
175175

176+
def ripple_get_address(self, args):
177+
address_n = self.client.expand_path(args.n)
178+
return self.client.ripple_get_address(address_n, args.show_display)
179+
176180
def ethereum_get_address(self, args):
177181
address_n = self.client.expand_path(args.n)
178182
address = self.client.ethereum_get_address(address_n, args.show_display)
@@ -546,6 +550,7 @@ class Commands(object):
546550
ping.help = 'Send ping message'
547551
get_address.help = 'Get bitcoin address in base58 encoding'
548552
get_xpub.help = 'Get xpub'
553+
ripple_get_address.help = 'Get Ripple address'
549554
ethereum_get_address.help = 'Get Ethereum address in hex encoding'
550555
ethereum_sign_msg.help = 'Sign Ethereum message'
551556
ethereum_sign_tx.help = 'Sign (and optionally publish) Ethereum transaction'
@@ -591,6 +596,11 @@ class Commands(object):
591596
(('-d', '--show-display'), {'action': 'store_true', 'default': False}),
592597
)
593598

599+
ripple_get_address.arguments = (
600+
(('-n', '-address'), {'type': str}),
601+
(('-d', '--show-display'), {'action': 'store_true', 'default': False}),
602+
)
603+
594604
ethereum_get_address.arguments = (
595605
(('-n', '-address'), {'type': str}),
596606
(('-d', '--show-display'), {'action': 'store_true', 'default': False}),

keepkeylib/eth/ethereum_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/env python3
1+
#!/usr/bin/env python3
22

33
from __future__ import print_function
44
import json

keepkeylib/eth/uniswap_tokens.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4542,5 +4542,13 @@
45424542
"contractAddress": "0x0Ae055097C6d159879521C384F1D2123D1f195e6",
45434543
"precision": 18,
45444544
"network": "ETH"
4545+
},
4546+
{
4547+
"symbol": "WETH",
4548+
"identifier": "weth",
4549+
"displayName": "Wrapped Ether",
4550+
"contractAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
4551+
"precision": 18,
4552+
"network": "ETH"
45454553
}
45464554
]

keepkeylib/eth/uniswap_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/env python3
1+
#!/usr/bin/env python3
22

33
from __future__ import print_function
44
import json

tests/test_msg_ethereum_erc20_uniswap_liquidity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class TestMsgEthereumUniswaptxERC20(common.KeepKeyTest):
2929

3030
def test_sign_uni_approve_liquidity_ETH(self):
3131
self.requires_fullFeature()
32-
self.requires_firmware("7.1.0")
32+
self.requires_firmware("7.13.0")
3333
self.setup_mnemonic_nopin_nopassphrase()
3434

3535
# Approval tx for the ETH/FOX pool

tests/test_msg_mayachain_signtx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def test_sign_btc_eth_swap(self):
7070

7171
def test_sign_eth_btc_swap(self):
7272
self.requires_firmware("7.1.0")
73+
self.requires_fullFeature()
7374
self.setup_mnemonic_nopin_nopassphrase()
7475
sig_v, sig_r, sig_s = self.client.ethereum_sign_tx(
7576
n=[2147483692,2147483708,2147483648,0,0],
@@ -116,6 +117,7 @@ def test_sign_btc_add_liquidity(self):
116117

117118
def test_sign_eth_add_liquidity(self):
118119
self.requires_firmware("7.9.1")
120+
self.requires_fullFeature()
119121
self.setup_mnemonic_nopin_nopassphrase()
120122
sig_v, sig_r, sig_s = self.client.ethereum_sign_tx(
121123
n=[2147483692,2147483708,2147483648,0,0],

0 commit comments

Comments
 (0)