test self spend filters

This commit is contained in:
wiesche
2026-09-08 10:35:18 +02:00
parent 6dac629842
commit 0177b49b05
5 changed files with 44 additions and 5 deletions
+2 -2
View File
@@ -200,9 +200,9 @@ pub struct RetrieveTxQueryArgs {
pub include_outstanding_only: Option<bool>,
/// whether to only consider confirmed-only transactions
pub include_confirmed_only: Option<bool>,
/// whether to only consider sent transactions
/// whether to only consider sent transactions, including self spends
pub include_sent_only: Option<bool>,
/// whether to only consider received transactions
/// whether to only consider received transactions, including self spends
pub include_received_only: Option<bool>,
/// whether to only consider coinbase transactions
pub include_coinbase_only: Option<bool>,
-1
View File
@@ -56,7 +56,6 @@ without a user confirmation step.
- Stop relying on TxLog offsets in contract tests.
- Finish the account-switching tests in `contract_accounts.rs`.
- Reuse the workspace `serde_with` version.
- Define and test how self-spends are handled by the sent and received filters.
### Side-effects
+3
View File
@@ -156,6 +156,7 @@ where
tx_entry.tx_type == TxLogEntryType::TxSent
|| tx_entry.tx_type == TxLogEntryType::TxSentCancelled
|| tx_entry.tx_type == TxLogEntryType::TxSelfSpend
|| tx_entry.tx_type == TxLogEntryType::TxSelfSpendCancelled
} else {
true
}
@@ -169,6 +170,7 @@ where
tx_entry.tx_type == TxLogEntryType::TxReceived
|| tx_entry.tx_type == TxLogEntryType::TxReceivedCancelled
|| tx_entry.tx_type == TxLogEntryType::TxSelfSpend
|| tx_entry.tx_type == TxLogEntryType::TxSelfSpendCancelled
} else {
true
}
@@ -191,6 +193,7 @@ where
if let Some(v) = query_args.include_self_spend_only {
if v {
tx_entry.tx_type == TxLogEntryType::TxSelfSpend
|| tx_entry.tx_type == TxLogEntryType::TxSelfSpendCancelled
} else {
true
}