Skip to content

Commit

Permalink
fix: rename received_amount to invoice_amount
Browse files Browse the repository at this point in the history
  • Loading branch information
yse committed Mar 21, 2024
1 parent 20592c6 commit af3280b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub struct OngoingSwap {
pub preimage: String,
pub redeem_script: String,
pub blinding_key: String,
pub requested_amount_sat: u64,
pub invoice_amount_sat: u64,
}

pub enum PaymentType {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/persist/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub(crate) fn current_migrations() -> Vec<&'static str> {
preimage TEXT NOT NULL,
redeem_script TEXT NOT NULL,
blinding_key TEXT NOT NULL,
requested_amount_sat INTEGER NOT NULL
invoice_amount_sat INTEGER
) STRICT;",
]
}
6 changes: 3 additions & 3 deletions lib/src/persist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Persister {
preimage,
redeem_script,
blinding_key,
requested_amount_sat
invoice_amount_sat
)
VALUES (?, ?, ?, ?, ?)
",
Expand All @@ -57,7 +57,7 @@ impl Persister {
&swap.preimage,
&swap.redeem_script,
&swap.blinding_key,
&swap.requested_amount_sat,
&swap.invoice_amount_sat,
))?
}

Expand Down Expand Up @@ -92,7 +92,7 @@ impl Persister {
preimage: row.get(1)?,
redeem_script: row.get(2)?,
blinding_key: row.get(3)?,
requested_amount_sat: row.get(4)?,
invoice_amount_sat: row.get(4)?,
})
}
}
4 changes: 2 additions & 2 deletions lib/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl Wallet {
preimage: preimage.to_string().expect("Expecting valid preimage"),
blinding_key: blinding_str,
redeem_script,
requested_amount_sat: amount_sat,
invoice_amount_sat: amount_sat,
}])
.map_err(|_| SwapError::PersistError)?;

Expand Down Expand Up @@ -370,7 +370,7 @@ impl Wallet {
id: None,
timestamp: None,
payment_type: PaymentType::Pending,
amount_sat: swap.requested_amount_sat,
amount_sat: swap.invoice_amount_sat,
},
);
}
Expand Down

0 comments on commit af3280b

Please sign in to comment.