mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-19 13:44:55 +01:00
feat: signature on mint witness
This commit is contained in:
@@ -207,8 +207,8 @@ WHERE active = 1
|
||||
let res = sqlx::query(
|
||||
r#"
|
||||
INSERT OR REPLACE INTO mint_quote
|
||||
(id, mint_url, amount, unit, request, state, expiry, request_lookup_id)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?);
|
||||
(id, mint_url, amount, unit, request, state, expiry, request_lookup_id, pubkey)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
|
||||
"#,
|
||||
)
|
||||
.bind(quote.id.to_string())
|
||||
@@ -219,6 +219,7 @@ VALUES (?, ?, ?, ?, ?, ?, ?, ?);
|
||||
.bind(quote.state.to_string())
|
||||
.bind(quote.expiry as i64)
|
||||
.bind(quote.request_lookup_id)
|
||||
.bind(quote.pubkey.map(|p| p.to_string()))
|
||||
.execute(&mut transaction)
|
||||
.await;
|
||||
|
||||
@@ -1265,6 +1266,7 @@ fn sqlite_row_to_mint_quote(row: SqliteRow) -> Result<MintQuote, Error> {
|
||||
let row_expiry: i64 = row.try_get("expiry").map_err(Error::from)?;
|
||||
let row_request_lookup_id: Option<String> =
|
||||
row.try_get("request_lookup_id").map_err(Error::from)?;
|
||||
let row_pubkey: Option<String> = row.try_get("pubkey").map_err(Error::from)?;
|
||||
|
||||
let request_lookup_id = match row_request_lookup_id {
|
||||
Some(id) => id,
|
||||
@@ -1274,6 +1276,10 @@ fn sqlite_row_to_mint_quote(row: SqliteRow) -> Result<MintQuote, Error> {
|
||||
},
|
||||
};
|
||||
|
||||
let pubkey = row_pubkey
|
||||
.map(|key| PublicKey::from_str(&key))
|
||||
.transpose()?;
|
||||
|
||||
Ok(MintQuote {
|
||||
id: row_id.into_uuid(),
|
||||
mint_url: MintUrl::from_str(&row_mint_url)?,
|
||||
@@ -1283,6 +1289,7 @@ fn sqlite_row_to_mint_quote(row: SqliteRow) -> Result<MintQuote, Error> {
|
||||
state: MintQuoteState::from_str(&row_state).map_err(Error::from)?,
|
||||
expiry: row_expiry as u64,
|
||||
request_lookup_id,
|
||||
pubkey,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user