mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 05:28:40 +00:00
annotate test transaction
This commit is contained in:
parent
e0fabc0acb
commit
e4b0e4d0c0
34
common/tests/fixtures/solana/sign_tx.json
vendored
34
common/tests/fixtures/solana/sign_tx.json
vendored
@ -7,10 +7,40 @@
|
|||||||
{
|
{
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"signer_path": "m/44'/501'/0'/0'",
|
"signer_path": "m/44'/501'/0'/0'",
|
||||||
"serialized_tx": "01000103c80f8b50107e9f3e3c16a661b8c806df454a6deb293d5e8730a9d28f2f4998c68f41927b2e58cbc31ed3aa5163a7b8ca4eb5590e8dc1dc682426cd2895aa9c0a00000000000000000000000000000000000000000000000000000000000000001aea57c9906a7cad656ff61b3893abda63f4b6b210c939855e7ab6e54049213d01020200010c02000000002d310100000000"
|
"annotated_serialized_tx": [
|
||||||
|
"#header",
|
||||||
|
"010001",
|
||||||
|
"#number of accounts",
|
||||||
|
"03",
|
||||||
|
"#accounts",
|
||||||
|
"00d1699dcb1811b50bb0055f13044463128242e37a463b52f6c97a1f6eef88ad",
|
||||||
|
"8f41927b2e58cbc31ed3aa5163a7b8ca4eb5590e8dc1dc682426cd2895aa9c0a",
|
||||||
|
"0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"#blockhash",
|
||||||
|
"1aea57c9906a7cad656ff61b3893abda63f4b6b210c939855e7ab6e54049213d",
|
||||||
|
"#instructions",
|
||||||
|
"#num_of_instructions",
|
||||||
|
"01",
|
||||||
|
"#instruction",
|
||||||
|
"#program id index (system)",
|
||||||
|
"02",
|
||||||
|
"#number of accounts",
|
||||||
|
"02",
|
||||||
|
"#accounts (from, to)",
|
||||||
|
"00", "01",
|
||||||
|
"#data",
|
||||||
|
"#data length",
|
||||||
|
"0c",
|
||||||
|
"#instruction id (transfer)",
|
||||||
|
"02000000",
|
||||||
|
"#data (lamports amount) (20000000)",
|
||||||
|
"002d310100000000"
|
||||||
|
|
||||||
|
],
|
||||||
|
"serialized_tx": "0100010300d1699dcb1811b50bb0055f13044463128242e37a463b52f6c97a1f6eef88ad8f41927b2e58cbc31ed3aa5163a7b8ca4eb5590e8dc1dc682426cd2895aa9c0a00000000000000000000000000000000000000000000000000000000000000001aea57c9906a7cad656ff61b3893abda63f4b6b210c939855e7ab6e54049213d01020200010c02000000002d310100000000"
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"expected_signature": "fa61c29a7cbd21598c856d83208465177fadb8c9a0ba96fa16a538ec95cd3e10f41b839e8db6135b5f18a9e3c94b7ed593794e91546c960ac45309512c36570c"
|
"expected_signature": "74a8360ed4342608fde93fedd48debf8b582264af94878b3d42fc52c7d4de87de090cd5c042783c6645a25b3bd4c394bac8cf23bcd530bad87601d9baa8c6d02"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -35,6 +35,9 @@ pytestmark = [
|
|||||||
def test_solana_sign_tx(client: Client, parameters, result):
|
def test_solana_sign_tx(client: Client, parameters, result):
|
||||||
client.init_device(new_session=True)
|
client.init_device(new_session=True)
|
||||||
|
|
||||||
|
# make sure the annotated transaction matches the original one
|
||||||
|
assert parameters["serialized_tx"] == "".join([i for i in parameters["annotated_serialized_tx"] if "#" not in i])
|
||||||
|
|
||||||
actual_result = sign_tx(
|
actual_result = sign_tx(
|
||||||
client,
|
client,
|
||||||
signer_path_n=parse_path(parameters["signer_path"]),
|
signer_path_n=parse_path(parameters["signer_path"]),
|
||||||
|
Loading…
Reference in New Issue
Block a user