From 9f825735ed6196a4637b5a52e61cac740a8a8b04 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Tue, 21 Aug 2018 14:52:00 +0200 Subject: [PATCH] stellar: public key methods removed --- trezorctl | 10 ---- trezorlib/client.py | 5 -- .../test_msg_stellar_get_address.py | 9 ---- .../test_msg_stellar_get_public_key.py | 50 ------------------- 4 files changed, 74 deletions(-) delete mode 100644 trezorlib/tests/device_tests/test_msg_stellar_get_public_key.py diff --git a/trezorctl b/trezorctl index aaa4607ada..8c8def7717 100755 --- a/trezorctl +++ b/trezorctl @@ -1041,16 +1041,6 @@ def stellar_get_address(connect, address, show_display): return client.stellar_get_address(address_n, show_display) -@cli.command(help='Get Stellar public key') -@click.option('-n', '--address', required=False, help="BIP32 path. Always use hardened paths and the m/44'/148'/ prefix", default=stellar.DEFAULT_BIP32_PATH) -@click.option('-d', '--show-display', is_flag=True) -@click.pass_obj -def stellar_get_public_key(connect, address, show_display): - client = connect() - address_n = tools.parse_path(address) - return binascii.hexlify(client.stellar_get_public_key(address_n, show_display)) - - @cli.command(help='Sign a base64-encoded transaction envelope') @click.option('-n', '--address', required=False, help="BIP32 path. Always use hardened paths and the m/44'/148'/ prefix", default=stellar.DEFAULT_BIP32_PATH) @click.option('-n', '--network-passphrase', default='Public Global Stellar Network ; September 2015', required=False, help="Network passphrase (blank for public network). Testnet is: 'Test SDF Network ; September 2015'") diff --git a/trezorlib/client.py b/trezorlib/client.py index 979bd8d1d8..3d6e5f1567 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -1088,11 +1088,6 @@ class ProtocolMixin(object): return self.call(proto.SelfTest(payload=b'\x00\xFF\x55\xAA\x66\x99\x33\xCCABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\x00\xFF\x55\xAA\x66\x99\x33\xCC')) - @field('public_key') - @expect(proto.StellarPublicKey) - def stellar_get_public_key(self, address_n, show_display=False): - return self.call(proto.StellarGetPublicKey(address_n=address_n, show_display=show_display)) - @field('address') @expect(proto.StellarAddress) def stellar_get_address(self, address_n, show_display=False): diff --git a/trezorlib/tests/device_tests/test_msg_stellar_get_address.py b/trezorlib/tests/device_tests/test_msg_stellar_get_address.py index f07b32ff53..0dd1ff0bc6 100644 --- a/trezorlib/tests/device_tests/test_msg_stellar_get_address.py +++ b/trezorlib/tests/device_tests/test_msg_stellar_get_address.py @@ -49,15 +49,6 @@ class TestMsgStellarGetAddress(TrezorTest): address = self.client.stellar_get_address(parse_path("m/44h/148h/1h"), show_display=True) assert address == 'GBAW5XGWORWVFE2XTJYDTLDHXTY2Q2MO73HYCGB3XMFMQ562Q2W2GJQX' - def test_stellar_get_address_get_pubkey(self): - self.setup_mnemonic_nopin_nopassphrase() - - pubkey = self.client.stellar_get_public_key(parse_path(stellar.DEFAULT_BIP32_PATH)) - # GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW - address = self.client.stellar_get_address(parse_path(stellar.DEFAULT_BIP32_PATH)) - - assert stellar.address_from_public_key(pubkey) == address - def test_stellar_get_address_fail(self): self.setup_mnemonic_nopin_nopassphrase() diff --git a/trezorlib/tests/device_tests/test_msg_stellar_get_public_key.py b/trezorlib/tests/device_tests/test_msg_stellar_get_public_key.py deleted file mode 100644 index 1442d97958..0000000000 --- a/trezorlib/tests/device_tests/test_msg_stellar_get_public_key.py +++ /dev/null @@ -1,50 +0,0 @@ -# This file is part of the Trezor project. -# -# Copyright (C) 2012-2018 SatoshiLabs and contributors -# -# This library is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the License along with this library. -# If not, see . - -import pytest - -from .common import TrezorTest -from .conftest import TREZOR_VERSION -from binascii import hexlify -from trezorlib import stellar -from trezorlib import messages -from trezorlib.client import CallException -from trezorlib.tools import parse_path - - -@pytest.mark.stellar -class TestMsgStellarGetPublicKey(TrezorTest): - - def test_stellar_get_public_key(self): - self.setup_mnemonic_nopin_nopassphrase() - - # GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW - response = self.client.stellar_get_public_key(parse_path(stellar.DEFAULT_BIP32_PATH), show_display=True) - assert hexlify(response) == b'15d648bfe4d36f196cfb5735ffd8ca54cd4b8233f743f22449de7cf301cdb469' - assert stellar.address_from_public_key(response) == 'GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW' - - def test_stellar_get_public_key_fail(self): - self.setup_mnemonic_nopin_nopassphrase() - - with pytest.raises(CallException) as exc: - self.client.stellar_get_public_key(parse_path('m/0/1')) - - if TREZOR_VERSION == 1: - assert exc.value.args[0] == messages.FailureType.ProcessError - assert exc.value.args[1].endswith('Failed to derive private key') - else: - assert exc.value.args[0] == messages.FailureType.FirmwareError - assert exc.value.args[1].endswith('Firmware error')