def test_stellar_get_address_sep(self, client): # data from https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md address = stellar.get_address(client, parse_path(stellar.DEFAULT_BIP32_PATH)) assert address == "GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6" address = stellar.get_address( client, parse_path("m/44h/148h/1h"), show_display=True ) assert address == "GBAW5XGWORWVFE2XTJYDTLDHXTY2Q2MO73HYCGB3XMFMQ562Q2W2GJQX"
def test_stellar_get_address_fail(self, client): with pytest.raises(CallException) as exc: stellar.get_address(client, parse_path("m/0/1")) if client.features.model == "1": assert exc.value.args[0] == proto.FailureType.ProcessError assert exc.value.args[1].endswith("Failed to derive private key") else: assert exc.value.args[0] == proto.FailureType.DataError assert exc.value.args[1].endswith("Forbidden key path")
def test_stellar_get_address_fail(self, client): with pytest.raises(TrezorFailure) as exc: stellar.get_address(client, parse_path("m/0/1")) if client.features.model == "1": assert exc.value.code == proto.FailureType.ProcessError assert exc.value.message.endswith("Failed to derive private key") else: assert exc.value.code == proto.FailureType.DataError assert exc.value.message == "Non-hardened paths unsupported on Ed25519"
def test_stellar_get_address_fail(self): self.setup_mnemonic_nopin_nopassphrase() with pytest.raises(CallException) as exc: stellar.get_address(self.client, parse_path("m/0/1")) if TREZOR_VERSION == 1: assert exc.value.args[0] == proto.FailureType.ProcessError assert exc.value.args[1].endswith("Failed to derive private key") else: assert exc.value.args[0] == proto.FailureType.FirmwareError assert exc.value.args[1].endswith("Firmware error")
def test_stellar_get_address_fail(self): self.setup_mnemonic_nopin_nopassphrase() with pytest.raises(CallException) as exc: stellar.get_address(self.client, parse_path("m/0/1")) if TREZOR_VERSION == 1: assert exc.value.args[0] == proto.FailureType.ProcessError assert exc.value.args[1].endswith("Failed to derive private key") else: assert exc.value.args[0] == proto.FailureType.DataError assert exc.value.args[1].endswith("Forbidden key path")
def test_stellar_get_address(self): self.setup_mnemonic_nopin_nopassphrase() address = stellar.get_address( self.client, parse_path(stellar.DEFAULT_BIP32_PATH) ) assert address == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW"
def test_stellar_get_address(self): self.setup_mnemonic_nopin_nopassphrase() address = stellar.get_address( self.client, parse_path(stellar.DEFAULT_BIP32_PATH) ) assert address == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW"
def test_stellar_get_address_sep(self): # data from https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md debuglink.load_device_by_mnemonic( self.client, mnemonic= "illness spike retreat truth genius clock brain pass fit cave bargain toe", pin="", passphrase_protection=False, label="test", language="english", ) address = stellar.get_address(self.client, parse_path(stellar.DEFAULT_BIP32_PATH)) assert address == "GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6" address = stellar.get_address(self.client, parse_path("m/44h/148h/1h"), show_display=True) assert address == "GBAW5XGWORWVFE2XTJYDTLDHXTY2Q2MO73HYCGB3XMFMQ562Q2W2GJQX"
def test_stellar_get_address_sep(self): # data from https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md debuglink.load_device_by_mnemonic( self.client, mnemonic="illness spike retreat truth genius clock brain pass fit cave bargain toe", pin="", passphrase_protection=False, label="test", language="english", ) address = stellar.get_address( self.client, parse_path(stellar.DEFAULT_BIP32_PATH) ) assert address == "GDRXE2BQUC3AZNPVFSCEZ76NJ3WWL25FYFK6RGZGIEKWE4SOOHSUJUJ6" address = stellar.get_address( self.client, parse_path("m/44h/148h/1h"), show_display=True ) assert address == "GBAW5XGWORWVFE2XTJYDTLDHXTY2Q2MO73HYCGB3XMFMQ562Q2W2GJQX"
def test_stellar_get_address(self, client): address = stellar.get_address(client, parse_path(stellar.DEFAULT_BIP32_PATH)) assert address == "GAK5MSF74TJW6GLM7NLTL76YZJKM2S4CGP3UH4REJHPHZ4YBZW2GSBPW"
def test_get_address(client, parameters, result): address_n = parse_path(parameters["path"]) address = stellar.get_address(client, address_n, show_display=True) assert address == result["address"]