From 593406ef469df4ac6d3ec89e0ff1ef07b77ae548 Mon Sep 17 00:00:00 2001 From: Nick Johnson Date: Thu, 26 May 2016 07:47:04 +0100 Subject: [PATCH] Rename to ethereum_get_address, use binascii.hexlify --- trezorctl | 10 +++++----- trezorlib/client.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/trezorctl b/trezorctl index b9b0a2a..9b79bae 100755 --- a/trezorctl +++ b/trezorctl @@ -99,10 +99,10 @@ class Commands(object): address_n = self.client.expand_path(args.n) return self.client.get_address(args.coin, address_n, args.show_display) - def get_ethereum_address(self, args): + def ethereum_get_address(self, args): address_n = self.client.expand_path(args.n) - address = self.client.get_ethereum_address(address_n, args.show_display) - return "0x%s" % (address.encode('hex'),) + address = self.client.ethereum_get_address(address_n, args.show_display) + return "0x%s" % (binascii.hexlify(address),) def get_entropy(self, args): return binascii.hexlify(self.client.get_entropy(args.size)) @@ -247,7 +247,7 @@ class Commands(object): list.help = 'List connected TREZOR USB devices' ping.help = 'Send ping message' get_address.help = 'Get bitcoin address in base58 encoding' - get_ethereum_address.help = 'Get Ethereum address in hex encoding' + ethereum_get_address.help = 'Get Ethereum address in hex encoding' get_entropy.help = 'Get example entropy' get_features.help = 'Retrieve device features and settings' get_public_node.help = 'Get public node of given path' @@ -274,7 +274,7 @@ class Commands(object): (('-d', '--show-display'), {'action': 'store_true', 'default': False}), ) - get_ethereum_address.arguments = ( + ethereum_get_address.arguments = ( (('-n', '-address'), {'type': str}), (('-d', '--show-display'), {'action': 'store_true', 'default': False}), ) diff --git a/trezorlib/client.py b/trezorlib/client.py index 1d2e5ea..da80742 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -419,7 +419,7 @@ class ProtocolMixin(object): @field('address') @expect(proto.EthereumAddress) - def get_ethereum_address(self, n, show_display=False, multisig=None): + def ethereum_get_address(self, n, show_display=False, multisig=None): n = self._convert_prime(n) return self.call(proto.EthereumGetAddress(address_n=n, show_display=show_display))