mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 15:21:39 +02:00
add doctest exercising advanced query JSON API
This commit is contained in:
@@ -203,8 +203,12 @@ pub struct RetrieveTxQueryArgs {
|
||||
/// whether to only consider reverted transactions
|
||||
pub include_reverted_only: Option<bool>,
|
||||
/// lower bound on the total amount (amount_credited - amount_debited), inclusive
|
||||
#[serde(with = "secp_ser::opt_string_or_u64")]
|
||||
#[serde(default)]
|
||||
pub min_amount_inc: Option<u64>,
|
||||
/// higher bound on the total amount (amount_credited - amount_debited), inclusive
|
||||
#[serde(with = "secp_ser::opt_string_or_u64")]
|
||||
#[serde(default)]
|
||||
pub max_amount_inc: Option<u64>,
|
||||
/// lower bound on the creation timestamp, inclusive
|
||||
pub min_creation_timestamp_inc: Option<DateTime<Utc>>,
|
||||
|
||||
@@ -25,6 +25,7 @@ use crate::grin_core::global;
|
||||
use crate::grin_core::libtx::proof::ProofBuilder;
|
||||
use crate::grin_core::libtx::reward;
|
||||
use crate::grin_keychain::{Identifier, Keychain, SwitchCommitmentType};
|
||||
use crate::grin_util as util;
|
||||
use crate::grin_util::secp::key::SecretKey;
|
||||
use crate::grin_util::secp::pedersen;
|
||||
use crate::grin_util::static_secp_instance;
|
||||
@@ -32,7 +33,6 @@ use crate::internal::keys;
|
||||
use crate::types::{
|
||||
NodeClient, OutputData, OutputStatus, TxLogEntry, TxLogEntryType, WalletBackend, WalletInfo,
|
||||
};
|
||||
use crate::{grin_util as util, Amount};
|
||||
use crate::{
|
||||
BlockFees, CbData, OutputCommitMapping, RetrieveTxQueryArgs, RetrieveTxQuerySortField,
|
||||
RetrieveTxQuerySortOrder,
|
||||
@@ -339,7 +339,7 @@ where
|
||||
C: NodeClient + 'a,
|
||||
K: Keychain + 'a,
|
||||
{
|
||||
let mut txs: Vec<TxLogEntry> = vec![];
|
||||
let mut txs;
|
||||
// Adding in new tranasction list query logic. If `tx_id` or `tx_slate_id`
|
||||
// is provided, then `query_args` is ignored and old logic is followed.
|
||||
if query_args.is_some() && tx_id.is_none() && tx_slate_id.is_none() {
|
||||
|
||||
Reference in New Issue
Block a user