Skip to content

Commit

Permalink
core/apps: await require_confirm should be called without return
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Feb 19, 2020
1 parent 2e2f5fd commit a808cc9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
8 changes: 4 additions & 4 deletions core/src/apps/lisk/layout.py
Expand Up @@ -15,21 +15,21 @@ async def require_confirm_tx(ctx, to, value):
text.bold(format_coin_amount(value))
text.normal("to")
text.mono(*split_address(to))
return await require_confirm(ctx, text, ButtonRequestType.SignTx)
await require_confirm(ctx, text, ButtonRequestType.SignTx)


async def require_confirm_delegate_registration(ctx, delegate_name):
text = Text("Confirm transaction", ui.ICON_SEND, ui.GREEN)
text.normal("Do you really want to")
text.normal("register a delegate?")
text.bold(*chunks(delegate_name, 20))
return await require_confirm(ctx, text, ButtonRequestType.SignTx)
await require_confirm(ctx, text, ButtonRequestType.SignTx)


async def require_confirm_vote_tx(ctx, votes):
text = Text("Confirm transaction", ui.ICON_SEND, ui.GREEN)
text.normal(*get_vote_tx_text(votes))
return await require_confirm(ctx, text, ButtonRequestType.SignTx)
await require_confirm(ctx, text, ButtonRequestType.SignTx)


async def require_confirm_public_key(ctx, public_key):
Expand All @@ -41,7 +41,7 @@ async def require_confirm_multisig(ctx, multisignature):
text.normal("Keys group length: %s" % len(multisignature.keys_group))
text.normal("Life time: %s" % multisignature.life_time)
text.normal("Min: %s" % multisignature.min)
return await require_confirm(ctx, text, ButtonRequestType.SignTx)
await require_confirm(ctx, text, ButtonRequestType.SignTx)


async def require_confirm_fee(ctx, value, fee):
Expand Down
8 changes: 4 additions & 4 deletions core/src/apps/monero/layout/confirms.py
Expand Up @@ -15,19 +15,19 @@
async def require_confirm_watchkey(ctx):
content = Text("Confirm export", ui.ICON_SEND, ui.GREEN)
content.normal("Do you really want to", "export watch-only", "credentials?")
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
await require_confirm(ctx, content, ButtonRequestType.SignTx)


async def require_confirm_keyimage_sync(ctx):
content = Text("Confirm ki sync", ui.ICON_SEND, ui.GREEN)
content.normal("Do you really want to", "sync key images?")
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
await require_confirm(ctx, content, ButtonRequestType.SignTx)


async def require_confirm_live_refresh(ctx):
content = Text("Confirm refresh", ui.ICON_SEND, ui.GREEN)
content.normal("Do you really want to", "start refresh?")
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
await require_confirm(ctx, content, ButtonRequestType.SignTx)


async def require_confirm_tx_key(ctx, export_key=False):
Expand All @@ -40,7 +40,7 @@ async def require_confirm_tx_key(ctx, export_key=False):
txt.append("for tx_proof?")

content.normal(*txt)
return await require_confirm(ctx, content, ButtonRequestType.SignTx)
await require_confirm(ctx, content, ButtonRequestType.SignTx)


async def require_confirm_transaction(ctx, state, tsx_data, network_type):
Expand Down
3 changes: 1 addition & 2 deletions core/src/apps/ripple/layout.py
Expand Up @@ -24,9 +24,8 @@ async def require_confirm_destination_tag(ctx, tag):


async def require_confirm_tx(ctx, to, value):

text = Text("Confirm sending", ui.ICON_SEND, ui.GREEN)
text.bold(format_amount(value, helpers.DECIMALS) + " XRP")
text.normal("to")
text.mono(*split_address(to))
return await require_hold_to_confirm(ctx, text, ButtonRequestType.SignTx)
await require_hold_to_confirm(ctx, text, ButtonRequestType.SignTx)
2 changes: 1 addition & 1 deletion core/src/apps/tezos/get_public_key.py
Expand Up @@ -28,4 +28,4 @@ async def _show_tezos_pubkey(ctx, pubkey):
lines = chunks(pubkey, 18)
text = Text("Confirm public key", ui.ICON_RECEIVE, ui.GREEN)
text.mono(*lines)
return await require_confirm(ctx, text, code=ButtonRequestType.PublicKey)
await require_confirm(ctx, text, code=ButtonRequestType.PublicKey)
6 changes: 3 additions & 3 deletions core/src/apps/tezos/layout.py
Expand Up @@ -14,7 +14,7 @@ async def require_confirm_tx(ctx, to, value):
text.bold(format_tezos_amount(value))
text.normal("to")
text.mono(*split_address(to))
return await require_confirm(ctx, text, ButtonRequestType.SignTx)
await require_confirm(ctx, text, ButtonRequestType.SignTx)


async def require_confirm_fee(ctx, value, fee):
Expand All @@ -30,7 +30,7 @@ async def require_confirm_origination(ctx, address):
text = Text("Confirm origination", ui.ICON_SEND, ui.ORANGE)
text.normal("Address:")
text.mono(*split_address(address))
return await require_confirm(ctx, text, ButtonRequestType.SignTx)
await require_confirm(ctx, text, ButtonRequestType.SignTx)


async def require_confirm_origination_fee(ctx, balance, fee):
Expand All @@ -46,7 +46,7 @@ async def require_confirm_delegation_baker(ctx, baker):
text = Text("Confirm delegation", ui.ICON_SEND, ui.BLUE)
text.normal("Baker address:")
text.mono(*split_address(baker))
return await require_confirm(ctx, text, ButtonRequestType.SignTx)
await require_confirm(ctx, text, ButtonRequestType.SignTx)


async def require_confirm_set_delegate(ctx, fee):
Expand Down

0 comments on commit a808cc9

Please sign in to comment.