From b41021a5fbf91e1ea3bf5ff479cf20f4c620d4f6 Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 15 Sep 2020 13:06:01 +0200 Subject: [PATCH] chore(python): fix kwargs usage --- python/src/trezorlib/eos.py | 23 ++++++++++++----------- python/src/trezorlib/fido.py | 6 ++++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/python/src/trezorlib/eos.py b/python/src/trezorlib/eos.py index d2e8176eff..55d3be7fbe 100644 --- a/python/src/trezorlib/eos.py +++ b/python/src/trezorlib/eos.py @@ -291,18 +291,19 @@ def parse_action(action): def parse_transaction_json(transaction): - header = messages.EosTxHeader() - header.expiration = int( - ( - datetime.strptime(transaction["expiration"], "%Y-%m-%dT%H:%M:%S") - - datetime(1970, 1, 1) - ).total_seconds() + header = messages.EosTxHeader( + expiration=int( + ( + datetime.strptime(transaction["expiration"], "%Y-%m-%dT%H:%M:%S") + - datetime(1970, 1, 1) + ).total_seconds() + ), + ref_block_num=int(transaction["ref_block_num"]), + ref_block_prefix=int(transaction["ref_block_prefix"]), + max_net_usage_words=int(transaction["max_net_usage_words"]), + max_cpu_usage_ms=int(transaction["max_cpu_usage_ms"]), + delay_sec=int(transaction["delay_sec"]), ) - header.ref_block_num = int(transaction["ref_block_num"]) - header.ref_block_prefix = int(transaction["ref_block_prefix"]) - header.max_net_usage_words = int(transaction["max_net_usage_words"]) - header.max_cpu_usage_ms = int(transaction["max_cpu_usage_ms"]) - header.delay_sec = int(transaction["delay_sec"]) actions = [parse_action(a) for a in transaction["actions"]] diff --git a/python/src/trezorlib/fido.py b/python/src/trezorlib/fido.py index 671dcf503e..c8c9b1cf10 100644 --- a/python/src/trezorlib/fido.py +++ b/python/src/trezorlib/fido.py @@ -25,12 +25,14 @@ def list_credentials(client): @expect(messages.Success, field="message") def add_credential(client, credential_id): - return client.call(messages.WebAuthnAddResidentCredential(credential_id)) + return client.call( + messages.WebAuthnAddResidentCredential(credential_id=credential_id) + ) @expect(messages.Success, field="message") def remove_credential(client, index): - return client.call(messages.WebAuthnRemoveResidentCredential(index)) + return client.call(messages.WebAuthnRemoveResidentCredential(index=index)) @expect(messages.Success, field="message")