Mint: lookup internal quote settlement by request (#478)

This commit is contained in:
callebtc
2024-03-16 17:14:50 +01:00
committed by GitHub
parent e7b1e0c0ed
commit 86b8f5811f
3 changed files with 28 additions and 12 deletions

View File

@@ -155,10 +155,10 @@ class LedgerCrud(ABC):
...
@abstractmethod
async def get_mint_quote_by_checking_id(
async def get_mint_quote_by_request(
self,
*,
checking_id: str,
request: str,
db: Database,
conn: Optional[Connection] = None,
) -> Optional[MintQuote]:
@@ -403,19 +403,19 @@ class LedgerCrudSqlite(LedgerCrud):
)
return MintQuote.from_row(row) if row else None
async def get_mint_quote_by_checking_id(
async def get_mint_quote_by_request(
self,
*,
checking_id: str,
request: str,
db: Database,
conn: Optional[Connection] = None,
) -> Optional[MintQuote]:
row = await (conn or db).fetchone(
f"""
SELECT * from {table_with_schema(db, 'mint_quotes')}
WHERE checking_id = ?
WHERE request = ?
""",
(checking_id,),
(request,),
)
return MintQuote.from_row(row) if row else None