mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-28 11:28:33 +01:00
test self spend filters
This commit is contained in:
@@ -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>,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user