diff --git a/trezorlib/client.py b/trezorlib/client.py index 7e569a573..811dc6c64 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -1098,10 +1098,12 @@ 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): return self.call(proto.StellarGetPublicKey(address_n=address_n)) + @field('address') @expect(proto.StellarAddress) def stellar_get_address(self, address_n): return self.call(proto.StellarGetAddress(address_n=address_n)) 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 7c73d2f7c..a20673e18 100644 --- a/trezorlib/tests/device_tests/test_msg_stellar_get_address.py +++ b/trezorlib/tests/device_tests/test_msg_stellar_get_address.py @@ -30,15 +30,14 @@ class TestMsgStellarGetAddress(TrezorTest): self.setup_mnemonic_nopin_nopassphrase() # GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW - response = self.client.stellar_get_address(parse_path(stellar.DEFAULT_BIP32_PATH)) - assert response.address == 'GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW' + address = self.client.stellar_get_address(parse_path(stellar.DEFAULT_BIP32_PATH)) + assert address == 'GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW' def test_stellar_get_address_get_pubkey(self): self.setup_mnemonic_nopin_nopassphrase() - pubkey_response = self.client.stellar_get_public_key(parse_path(stellar.DEFAULT_BIP32_PATH)) - + pubkey = self.client.stellar_get_public_key(parse_path(stellar.DEFAULT_BIP32_PATH)) # GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW - address_response = self.client.stellar_get_address(parse_path(stellar.DEFAULT_BIP32_PATH)) + address = self.client.stellar_get_address(parse_path(stellar.DEFAULT_BIP32_PATH)) - assert stellar.address_from_public_key(pubkey_response.public_key).decode('utf8') == address_response.address + assert stellar.address_from_public_key(pubkey).decode('utf8') == address 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 index 637763ce9..e55dd0e71 100644 --- a/trezorlib/tests/device_tests/test_msg_stellar_get_public_key.py +++ b/trezorlib/tests/device_tests/test_msg_stellar_get_public_key.py @@ -30,5 +30,5 @@ class TestMsgStellarGetPublicKey(TrezorTest): # GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW response = self.client.stellar_get_public_key(parse_path(stellar.DEFAULT_BIP32_PATH)) - assert hexlify(response.public_key) == b'15d648bfe4d36f196cfb5735ffd8ca54cd4b8233f743f22449de7cf301cdb469' - assert stellar.address_from_public_key(response.public_key) == b'GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW' + assert hexlify(response) == b'15d648bfe4d36f196cfb5735ffd8ca54cd4b8233f743f22449de7cf301cdb469' + assert stellar.address_from_public_key(response) == b'GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW'