-
Notifications
You must be signed in to change notification settings - Fork 43
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 transactions method on wallet #432
Conversation
f5f38dc
to
9c9010d
Compare
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.
I think this works in practice, but I have 2 questions about the theory I'm still wondering about:
- The API doc for the method is one line:
Iterate over the transactions in the wallet.
. I wonder if (a) this is meant to be used for more than just returning the transactions, and (b) only returns transactions "owned" by the wallet. For example I see that it's basically traversing the TxGraph... but if I understand correctly you can add any transactions to this TxGraph (?) - The type of CanonicalTx.TxNode.tx is
&'a T
, which I don't understand well. Will you always be able to get aTransaction
type out of it when you apply the .into() method on it?
6ab8eea
to
27c10a7
Compare
Great Q’s/Feedback Thunder! I think I caught some of the conversation about this on the dev call this morning, and I think(?) what I heard as the conclusion is that we are leaving this If that is all correct than is it cool to add If my understanding is incorrect I can update to whatever is needed, happy to do whatever needed, and I enjoyed the conversation and questions around this PR so far. |
27c10a7
to
f7030a5
Compare
Yeah roughly my take on it is that isMine is implied in the the
Edit: I forgot to write it initially but the problem with this of course is that we're transforming the API, and so far we've been trying to keep them in very close sync; this would be a departure from that, so should be thought through seriously. We'll also see what comes out of the discussion in #1239 |
f7030a5
to
e9a6818
Compare
I'm changing my mind on this. I think we should expose the API as is on the Rust side, and open issues/fix it upstream if there are things to improve. For now, exposing it as is is the better/cleaner way. We also don't offer ways to impact the TxGraph manually at this point on the ffi side, so the problems that this could cause are limited. |
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.
Just a small nit. This is ready to go afterwards IMO. I tested locally.
e9a6818
to
5ab6bc9
Compare
5ab6bc9
to
a1a4599
Compare
@thunderbiscuit PR is updated now per suggestions and tests pass, thanks! |
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.
ACK a1a4599.
Description
Adds transactions method on
Wallet
.Notes to the reviewers
Simplified return type to list of
Transaction
s.Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes: