|
|
@@ -254,11 +254,6 @@ impl MeltSaga<Initial> {
|
|
|
|
|
|
let previous_state = quote.state;
|
|
|
|
|
|
- // Publish proof state changes
|
|
|
- for pk in input_ys.iter() {
|
|
|
- self.pubsub.proof_state((*pk, State::Pending));
|
|
|
- }
|
|
|
-
|
|
|
if input_unit != Some(quote.unit.clone()) {
|
|
|
tx.rollback().await?;
|
|
|
return Err(Error::UnitMismatch);
|
|
|
@@ -292,9 +287,6 @@ impl MeltSaga<Initial> {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- self.pubsub
|
|
|
- .melt_quote_status(&*quote, None, None, MeltQuoteState::Pending);
|
|
|
-
|
|
|
let inputs_fee_breakdown = self.mint.get_proofs_fee(melt_request.inputs()).await?;
|
|
|
let inputs_fee = inputs_fee_breakdown.total.with_unit(quote.unit.clone());
|
|
|
let fee_reserve = quote.fee_reserve();
|
|
|
@@ -377,6 +369,14 @@ impl MeltSaga<Initial> {
|
|
|
}
|
|
|
|
|
|
tx.commit().await?;
|
|
|
+ // Publish proof state changes
|
|
|
+ for pk in input_ys.iter() {
|
|
|
+ self.pubsub.proof_state((*pk, State::Pending));
|
|
|
+ }
|
|
|
+
|
|
|
+ // Publish melt quote status change AFTER transaction commits
|
|
|
+ self.pubsub
|
|
|
+ .melt_quote_status(&*quote, None, None, MeltQuoteState::Pending);
|
|
|
|
|
|
// Store blinded messages for state
|
|
|
let blinded_messages_vec = melt_request.outputs().clone().unwrap_or_default();
|
|
|
@@ -523,6 +523,7 @@ impl MeltSaga<SetupComplete> {
|
|
|
mint_quote.add_payment(amount.clone(), self.state_data.quote.id.to_string(), None)?;
|
|
|
tx.update_mint_quote(&mut mint_quote).await?;
|
|
|
|
|
|
+ tx.commit().await?;
|
|
|
self.pubsub
|
|
|
.mint_quote_payment(&mint_quote, mint_quote.amount_paid());
|
|
|
|
|
|
@@ -532,8 +533,6 @@ impl MeltSaga<SetupComplete> {
|
|
|
mint_quote.id
|
|
|
);
|
|
|
|
|
|
- tx.commit().await?;
|
|
|
-
|
|
|
Ok((self, SettlementDecision::Internal { amount }))
|
|
|
}
|
|
|
|