1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 06:18:07 +00:00

chore(python): fix kwargs usage

This commit is contained in:
matejcik 2020-09-15 13:06:01 +02:00 committed by matejcik
parent 5ddf1dfafb
commit b41021a5fb
2 changed files with 16 additions and 13 deletions

View File

@ -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"]]

View File

@ -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")