mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-30 17:21:21 +00:00
test_stellar.py - fix style issues
This commit is contained in:
parent
af38407a43
commit
05afd986c1
@ -34,6 +34,7 @@ def test_stellar_parse_transaction_bytes_simple():
|
||||
assert tx.memo_hash is None
|
||||
assert tx.num_operations == len(operations)
|
||||
|
||||
|
||||
def test_stellar_parse_transaction_bytes_memo_text():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAEAAAAMZXhhbXBsZSBtZW1vAAAAAQAAAAAAAAAAAAAAAF1VZCRmsYW4QxUuniGRUdvFiSAn7EAQGlF77VygMMLgAAAAADuf3sgAAAAA'
|
||||
|
||||
@ -50,6 +51,7 @@ def test_stellar_parse_transaction_bytes_memo_text():
|
||||
assert tx.memo_hash is None
|
||||
assert tx.num_operations == len(operations)
|
||||
|
||||
|
||||
def test_stellar_parse_transaction_bytes_memo_id():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAIAAAAAB1vNFQAAAAEAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAA7n97IAAAAAA=='
|
||||
|
||||
@ -66,6 +68,7 @@ def test_stellar_parse_transaction_bytes_memo_id():
|
||||
assert tx.memo_hash is None
|
||||
assert tx.num_operations == len(operations)
|
||||
|
||||
|
||||
def test_stellar_parse_transaction_bytes_memo_hash():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAMjLtb5+r8U47tVOSsYz+PQ/ryU0gzGMnw4odB11uoRjAAAAAEAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAA7n97IAAAAAA=='
|
||||
|
||||
@ -83,6 +86,7 @@ def test_stellar_parse_transaction_bytes_memo_hash():
|
||||
assert base64.b64encode(tx.memo_hash) == b'Iy7W+fq/FOO7VTkrGM/j0P68lNIMxjJ8OKHQddbqEYw='
|
||||
assert tx.num_operations == len(operations)
|
||||
|
||||
|
||||
def test_stellar_parse_transaction_bytes_memo_return():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAQjLtb5+r8U47tVOSsYz+PQ/ryU0gzGMnw4odB11uoRjAAAAAEAAAAAAAAAAAAAAABdVWQkZrGFuEMVLp4hkVHbxYkgJ+xAEBpRe+1coDDC4AAAAAA7n97IAAAAAA=='
|
||||
|
||||
@ -100,6 +104,7 @@ def test_stellar_parse_transaction_bytes_memo_return():
|
||||
assert base64.b64encode(tx.memo_hash) == b'Iy7W+fq/FOO7VTkrGM/j0P68lNIMxjJ8OKHQddbqEYw='
|
||||
assert tx.num_operations == len(operations)
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_create_account_simple():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAAO5/eyAAAAAA='
|
||||
|
||||
@ -111,6 +116,7 @@ def test_stellar_parse_operation_bytes_create_account_simple():
|
||||
assert op.new_account == b'GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V'
|
||||
assert op.starting_balance == 1000333000
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_payment_native():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAAAAAAAB3PFpgAAAAA'
|
||||
|
||||
@ -123,6 +129,7 @@ def test_stellar_parse_operation_bytes_payment_native():
|
||||
assert op.asset.type == stellar.ASSET_TYPE_NATIVE
|
||||
assert op.amount == 500111000
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_payment_custom4():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAABVEVTVAAAAAAphJYCwg5YNl8SPBLYehykVQ0QzSGwrg4Y1E4+Vv1qFQAAAAAdzxaYAAAAAA=='
|
||||
|
||||
@ -136,6 +143,7 @@ def test_stellar_parse_operation_bytes_payment_custom4():
|
||||
assert op.asset.issuer == b'GAUYJFQCYIHFQNS7CI6BFWD2DSSFKDIQZUQ3BLQODDKE4PSW7VVBKENC'
|
||||
assert op.amount == 500111000
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_payment_custom7():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAACU0VWRU5YWAAAAAAAAAAAACmElgLCDlg2XxI8Eth6HKRVDRDNIbCuDhjUTj5W/WoVAAAAAB3PFpgAAAAA'
|
||||
|
||||
@ -151,6 +159,7 @@ def test_stellar_parse_operation_bytes_payment_custom7():
|
||||
assert op.asset.issuer == b'GAUYJFQCYIHFQNS7CI6BFWD2DSSFKDIQZUQ3BLQODDKE4PSW7VVBKENC'
|
||||
assert op.amount == 500111000
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_path_payment_none():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAAAAAAAHfOKn8AAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAABSlBZAAAAAADE+xa3Eb3cy85WSdqgwnUtC6UDwrC41YDANuCqe8vGxgAAAAAL68IBAAAAAAAAAAA='
|
||||
|
||||
@ -172,6 +181,7 @@ def test_stellar_parse_operation_bytes_path_payment_none():
|
||||
|
||||
assert len(op.paths) == 0
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_path_payment_one():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAAAAAAAHfOKn8AAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAABSlBZAAAAAADE+xa3Eb3cy85WSdqgwnUtC6UDwrC41YDANuCqe8vGxgAAAAAL68IBAAAAAQAAAAFQVEgxAAAAAMz/d9fJ3rFifblw3jT7sRZv/Ja+fqLfob//aLZQRQibAAAAAA=='
|
||||
|
||||
@ -197,6 +207,7 @@ def test_stellar_parse_operation_bytes_path_payment_one():
|
||||
assert op.paths[0].code == b'PTH1'
|
||||
assert op.paths[0].issuer == b'GDGP656XZHPLCYT5XFYN4NH3WELG77EWXZ7KFX5BX77WRNSQIUEJXAJK'
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_manage_offer_new():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAMAAAAAAAAAAVVTRAAAAAAABkAD8fq0d+bofA1LCatUL0dCTJexnyYYd4Y1ghnNUXMAAAAAdzWUAAAKSzYAD0JAAAAAAAAAAAAAAAAA'
|
||||
|
||||
@ -216,7 +227,8 @@ def test_stellar_parse_operation_bytes_manage_offer_new():
|
||||
assert op.amount == 2000000000
|
||||
assert op.price_n == 674614
|
||||
assert op.price_d == 1000000
|
||||
assert op.offer_id == 0 # indicates a new offer
|
||||
assert op.offer_id == 0 # indicates a new offer
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_passive_offer_new():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAQAAAAAAAAAAVVTRAAAAAAABkAD8fq0d+bofA1LCatUL0dCTJexnyYYd4Y1ghnNUXMAAAAAdzWUAAAKSzYAD0JAAAAAAA=='
|
||||
@ -238,6 +250,7 @@ def test_stellar_parse_operation_bytes_passive_offer_new():
|
||||
assert op.price_n == 674614
|
||||
assert op.price_d == 1000000
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_set_options_inflation():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAABAAAAAAt5i66vbwH70/2M4Oj0rQW81SNLAjfOsMV2bavzocXhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
|
||||
|
||||
@ -249,6 +262,7 @@ def test_stellar_parse_operation_bytes_set_options_inflation():
|
||||
|
||||
assert op.inflation_destination_account == b'GAFXTC5OV5XQD66T7WGOB2HUVUC3ZVJDJMBDPTVQYV3G3K7TUHC6CLBR'
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_change_trust_add():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAYAAAABVVNEAAAAAACkn7CoQZEWAlyO6z6VBUAddrDDR078TtLt/nP/hZJ9KQAAAAJUC+QAAAAAAA=='
|
||||
|
||||
@ -264,6 +278,7 @@ def test_stellar_parse_operation_bytes_change_trust_add():
|
||||
|
||||
assert op.limit == 10000000000
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_allow_trust_allow():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAcAAAAAZ0Me3OnxI2tuaC8qt95THF1fuB42qARTnP2ookJapQUAAAABSlBZAAAAAAEAAAAA'
|
||||
|
||||
@ -278,6 +293,7 @@ def test_stellar_parse_operation_bytes_allow_trust_allow():
|
||||
|
||||
assert op.trusted_account == b'GBTUGHW45HYSG23ONAXSVN66KMOF2X5YDY3KQBCTTT62RISCLKSQLYF4'
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_account_merge_simple():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAXVVkJGaxhbhDFS6eIZFR28WJICfsQBAaUXvtXKAwwuAAAAAA'
|
||||
|
||||
@ -289,6 +305,7 @@ def test_stellar_parse_operation_bytes_account_merge_simple():
|
||||
|
||||
assert op.destination_account == b'GBOVKZBEM2YYLOCDCUXJ4IMRKHN4LCJAE7WEAEA2KF562XFAGDBOB64V'
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_manage_data_set_simple():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAoAAAAJdGVzdCBkYXRhAAAAAAAAAQAAAARhc2RmAAAAAA=='
|
||||
|
||||
@ -301,6 +318,7 @@ def test_stellar_parse_operation_bytes_manage_data_set_simple():
|
||||
assert op.key == b'test data'
|
||||
assert op.value == b'asdf'
|
||||
|
||||
|
||||
def test_stellar_parse_operation_bytes_bump_sequence_simple():
|
||||
b64 = b'AAAAABXWSL/k028ZbPtXNf/YylTNS4Iz90PyJEnefPMBzbRpAAAAZAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAsAAAAASZYC0gAAAAA='
|
||||
|
||||
@ -310,4 +328,4 @@ def test_stellar_parse_operation_bytes_bump_sequence_simple():
|
||||
assert isinstance(op, proto.StellarBumpSequenceOp)
|
||||
assert op.source_account is None
|
||||
|
||||
assert op.bump_to == 1234567890
|
||||
assert op.bump_to == 1234567890
|
||||
|
Loading…
Reference in New Issue
Block a user