From c4d60013fd3dd972db45ca4daaf9b5d849de63f4 Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Thu, 7 Oct 2021 10:33:56 +0200 Subject: [PATCH] parse remainingAttempts from wrong pin error (cherry picked from commit f6fa69e9dcc8bf251f85a594a1e6340a848e85dc) --- backends/statusgo/keycard.nim | 2 +- types/keycard.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/statusgo/keycard.nim b/backends/statusgo/keycard.nim index 1bf9242..774b64b 100644 --- a/backends/statusgo/keycard.nim +++ b/backends/statusgo/keycard.nim @@ -65,7 +65,7 @@ method keycardVerifyPin*(self: StatusGoBackend, pin: string) = let response = keycard_go.verifyPin($inputJSON) let parsedResponse = parseJson(response) if not parsedResponse{"ok"}.getBool(): - raise KeycardVerifyPINException(error: parsedResponse{"error"}.getStr()) + raise KeycardVerifyPINException(error: parsedResponse{"error"}.getStr(), remainingAttempts: parsedResponse{"remainingAttempts"}.getInt()) method keycardExportKey*(self: StatusGoBackend, derive: bool, makeCurrent: bool, onlyPublic: bool, path: string): KeycardExportedKey = let inputJSON = %* { diff --git a/types/keycard.nim b/types/keycard.nim index 227d51d..d658208 100644 --- a/types/keycard.nim +++ b/types/keycard.nim @@ -18,7 +18,7 @@ type KeycardUnpairException* = ref object of KeycardException type KeycardGenerateKeyException* = ref object of KeycardException type KeycardVerifyPINException* = ref object of KeycardException - pinRetry*: int64 + remainingAttempts*: int64 type KeycardExportKeyException* = ref object of KeycardException