1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-29 17:48:10 +00:00

stellar tests - fix imports and indicate that tests are currently expected to fail

This commit is contained in:
ZuluCrypto 2018-04-20 10:35:01 -06:00
parent 61f5e1df61
commit 49025aad2b
No known key found for this signature in database
GPG Key ID: 0D1266F87C28A2E1
2 changed files with 10 additions and 8 deletions

View File

@ -13,9 +13,10 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with this library. If not, see <http://www.gnu.org/licenses/>. # along with this library. If not, see <http://www.gnu.org/licenses/>.
from .common import * from .common import TrezorTest
import trezorlib.stellar as stellar from trezorlib import stellar
@pytest.mark.xfail # requires trezor-mcu PR #259
class TestMsgStellarGetPublicKey(TrezorTest): class TestMsgStellarGetPublicKey(TrezorTest):
def test_stellar_get_address(self): def test_stellar_get_address(self):

View File

@ -17,9 +17,10 @@
# https://www.stellar.org/laboratory/#xdr-viewer # https://www.stellar.org/laboratory/#xdr-viewer
# #
import base64 from base64 import b64decode, b64encode
from .common import * from .common import TrezorTest
@pytest.mark.xfail # requires trezor-mcu PR #259
class TestMsgStellarSignTransaction(TrezorTest): class TestMsgStellarSignTransaction(TrezorTest):
def get_network_passphrase(self): def get_network_passphrase(self):
@ -33,16 +34,16 @@ class TestMsgStellarSignTransaction(TrezorTest):
def test_sign_tx_bump_sequence_op(self): def test_sign_tx_bump_sequence_op(self):
self.setup_mnemonic_nopin_nopassphrase() self.setup_mnemonic_nopin_nopassphrase()
xdr = base64.b64decode("AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAt//////////wAAAAAAAAAA") xdr = b64decode("AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAt//////////wAAAAAAAAAA")
response = self.client.stellar_sign_transaction(xdr, self.get_address_n(), self.get_network_passphrase()) response = self.client.stellar_sign_transaction(xdr, self.get_address_n(), self.get_network_passphrase())
assert base64.b64encode(response.signature) == b'UAOL4ZPYIOzEgM66kBrhyNjLR66dNXtuNrmvd3m0/pc8qCSoLmYY4TybS0lHiMtb+LFZESTaxrpErMHz1sZ6DQ==' assert b64encode(response.signature) == b'UAOL4ZPYIOzEgM66kBrhyNjLR66dNXtuNrmvd3m0/pc8qCSoLmYY4TybS0lHiMtb+LFZESTaxrpErMHz1sZ6DQ=='
def test_sign_tx_account_merge_op(self): def test_sign_tx_account_merge_op(self):
self.setup_mnemonic_nopin_nopassphrase() self.setup_mnemonic_nopin_nopassphrase()
xdr = base64.b64decode("AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAAAAAAAQHNtGkAAABAgjoPRj4sW5o7NAXzYOqPK0uxfPbeKb4Qw48LJiCH/XUZ6YVCiZogePC0Z5ISUlozMh6YO6HoYtuLPbm7jq+eCA==") xdr = b64decode("AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAAAAAAAQHNtGkAAABAgjoPRj4sW5o7NAXzYOqPK0uxfPbeKb4Qw48LJiCH/XUZ6YVCiZogePC0Z5ISUlozMh6YO6HoYtuLPbm7jq+eCA==")
response = self.client.stellar_sign_transaction(xdr, self.get_address_n(), self.get_network_passphrase()) response = self.client.stellar_sign_transaction(xdr, self.get_address_n(), self.get_network_passphrase())
assert base64.b64encode(response.signature) == b'gjoPRj4sW5o7NAXzYOqPK0uxfPbeKb4Qw48LJiCH/XUZ6YVCiZogePC0Z5ISUlozMh6YO6HoYtuLPbm7jq+eCA==' assert b64encode(response.signature) == b'gjoPRj4sW5o7NAXzYOqPK0uxfPbeKb4Qw48LJiCH/XUZ6YVCiZogePC0Z5ISUlozMh6YO6HoYtuLPbm7jq+eCA=='