-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add list transactions command to the wallet #1527
Conversation
wallet/wallet-rpc-lib/src/rpc/mod.rs
Outdated
@@ -351,6 +351,29 @@ impl<N: NodeInterface + Clone + Send + Sync + 'static> WalletRpc<N> { | |||
.await? | |||
} | |||
|
|||
pub async fn confirmed_transactions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "confirmed" is very dangerous to use. We still haven't formalized what "confirmed" really means. In bitcoin, confirmation depends on the number of blocks stacked above the block where the transaction resides. You'll notice also that "confirmed" always comes accompanied with a parameter "depth" or "number of confirmation", as a filter, exactly for this reason.
For us, it's much more complicated and there's a fair amount of math involved to decide what a "confirmed" transaction really is.
I would feel more comfortable calling this mainchain_transactions
, because that doesn't give any sense of "confirmed". We can go back to the problem of "confirmations" later.
@@ -650,6 +650,16 @@ pub enum WalletCommand { | |||
#[clap(name = "transaction-list-pending")] | |||
ListPendingTransactions, | |||
|
|||
/// List confirmed transactions with optional address filter | |||
#[clap(name = "transaction-list-confirmed")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transaction-list-by-address
destination: Option<Destination>, | ||
limit: usize, | ||
) -> Vec<WithId<&Transaction>> { | ||
self.txs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to order these transactions in descending order, from newest to oldest?
5621d72
to
26b6ae8
Compare
wallet/src/wallet/tests.rs
Outdated
#[rstest] | ||
#[trace] | ||
#[case(Seed::from_entropy())] | ||
fn wallet_list_confirmed_transactions(#[case] seed: Seed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the minor comment, good to go.
26b6ae8
to
069919b
Compare
069919b
to
a8ea2ae
Compare
new wallet command to list the confirmed transactions, with an optional filter based on address, and a limit