From 2c93fee5652ce58094bbcef690b702f8c2d24582 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 9 Oct 2022 10:54:42 +0200 Subject: [PATCH] fix --- cashu/core/base.py | 4 +++- cashu/core/crypto.py | 3 ++- cashu/mint/router.py | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cashu/core/base.py b/cashu/core/base.py index dd9a248..d54913a 100644 --- a/cashu/core/base.py +++ b/cashu/core/base.py @@ -268,8 +268,10 @@ class MintKeyset: def from_row(cls, row: Row): if row is None: return cls + # fix to convert byte to string, unclear why this is necessary + id = row[0].decode("ascii") if type(row[0]) == bytes else row[0] return cls( - id=row[0].decode("ascii"), + id=id, derivation_path=row[1], valid_from=row[2], valid_to=row[3], diff --git a/cashu/core/crypto.py b/cashu/core/crypto.py index 15a8023..379d3ed 100644 --- a/cashu/core/crypto.py +++ b/cashu/core/crypto.py @@ -1,6 +1,7 @@ +import base64 import hashlib from typing import Dict, List -import base64 + from cashu.core.secp import PrivateKey, PublicKey from cashu.core.settings import MAX_ORDER diff --git a/cashu/mint/router.py b/cashu/mint/router.py index e7842d7..ae78859 100644 --- a/cashu/mint/router.py +++ b/cashu/mint/router.py @@ -15,7 +15,6 @@ from cashu.core.base import ( SplitRequest, ) from cashu.core.errors import CashuError - from cashu.mint import ledger router: APIRouter = APIRouter()