FIX: NUT04 breaking change

This commit is contained in:
thesimplekid
2023-05-03 20:03:18 -04:00
parent 2940e9d67a
commit d138135613
3 changed files with 5 additions and 13 deletions

View File

@@ -45,17 +45,10 @@ impl CashuWallet {
}
/// Mint Token
pub async fn mint_token(
&self,
amount: Amount,
payment_hash: &str,
) -> Result<Vec<Proof>, Error> {
pub async fn mint_token(&self, amount: Amount, hash: &str) -> Result<Vec<Proof>, Error> {
let blinded_messages = BlindedMessages::random(amount)?;
let mint_res = self
.client
.mint(blinded_messages.clone(), payment_hash)
.await?;
let mint_res = self.client.mint(blinded_messages.clone(), hash).await?;
let proofs = construct_proofs(
mint_res.promises,

View File

@@ -64,11 +64,10 @@ impl Client {
pub async fn mint(
&self,
blinded_messages: BlindedMessages,
payment_hash: &str,
hash: &str,
) -> Result<PostMintResponse, Error> {
let mut url = self.mint_url.join("mint")?;
url.query_pairs_mut()
.append_pair("payment_hash", payment_hash);
url.query_pairs_mut().append_pair("hash", hash);
let request = MintRequest {
outputs: blinded_messages.blinded_messages,

View File

@@ -136,7 +136,7 @@ pub struct MintKeySets {
pub struct RequestMintResponse {
/// Bolt11 payment request
pub pr: Invoice,
/// Hash of Invoice
/// Random Hash
pub hash: String,
}