예제 #1
0
async def respond_Pong(session_id, msg):
    from trezor.messages.Success import Success

    s = Success()
    s.message = msg.message

    if msg.pin_protection:
        from apps.common.request_pin import protect_by_pin
        await protect_by_pin(session_id)

    if msg.passphrase_protection:
        from apps.common.request_passphrase import protect_by_passphrase
        await protect_by_passphrase(session_id)

    # TODO: handle other fields:
    # button_protection
    return s
예제 #2
0
async def respond_Pong(ctx, msg):
    from trezor.messages.Success import Success

    s = Success()
    s.message = msg.message

    if msg.button_protection:
        from apps.common.confirm import require_confirm
        from trezor.messages.ButtonRequestType import ProtectCall
        from trezor.ui.text import Text
        from trezor import ui
        await require_confirm(ctx, Text('Confirm', ui.ICON_RESET), ProtectCall)

    if msg.passphrase_protection:
        from apps.common.request_passphrase import protect_by_passphrase
        await protect_by_passphrase(ctx)

    return s