-
Notifications
You must be signed in to change notification settings - Fork 23
Bring back TxDetails #201
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
base: master
Are you sure you want to change the base?
Bring back TxDetails #201
Conversation
Pull Request Test Coverage Report for Build 15187463781Details
💛 - Coveralls |
48e4454
to
815931d
Compare
Who TH is this coveralls bot? @coveralls explain yourself and tell me why I shouldn't just cut you out of my codebase my man |
dd9f341
to
06b0ed7
Compare
0e2ca1c
to
45135b3
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.
Concept ACK. I did a first pass looks great so far.
b5fbc82
to
00a3b9b
Compare
Tagging some folks who had expressed interest in the feature: @matthiasdebernardini and @tnull. I have a nagging feeling that there is probably more we want to have in this struct, and if we're going to build one then we might as well put the good stuff in it. Just wondering if you (or anyone else) has anything else they'd like to see as part of a struct that represent transaction details. |
Hey thanks! I'd also want a net impact in terms of balance on a per transaction basis. We had to build this ourselves but I think it would be very useful. |
Ah yes I remember! Do you remember the issue number for the brainstorm/PR on this? I'll need to refresh my memory on what exactly we landed on. But that's a good idea. |
I think it was on discord, this is what we have implemented pub struct WalletHistoryRecord {
pub height: Option<u32>,
pub node_info: TxNodeInfo,
pub received: u64,
pub sent: u64,
pub delta: i128,
pub balance: i128,
pub txid: Txid,
}
pub struct TxNodeInfo {
pub block_timestamp: Option<u32>,
pub mempool_time: Option<u64>,
} We use this to check if a wallet is spending too much money in a given time period (app specific) but I think its useful for building wallet summaries anyways. If you want to implement this, you will need to also figure out a way to canonically sort these transactions if theres multiple transactions in the same block, if its random then youll get a different history each time you call it. So far, I like what you have, but I would add wallet balance and the net change to the wallet. |
1fa0f75
to
6561564
Compare
Just linking here so I don't have so search for it later on: #31. |
Thanks for the feedback. @matthiasdebernardini I decided to go with @ValuedMammal I know you'd talked about using the name @matthiasdebernardini I left out for now the idea of balance as part of this struct, because I feel like that's a bit different. It's not about the transaction per se, but really about the balance of the wallet at the time (and here the struct assumes the given transaction is the latest tx I guess?). I'm not again adding it, but I'm not yet convinced of the true value. Again thanks for the feedback, this is ready for some more bikeshedding if needed! |
@thunderbiscuit, if youre not going to add it, then you should provide a method that calculates a balance at a given height, that would be more useful, maybe for another PR. But yeah balance delta is a good name! |
You know I had not thought about this before but it does sound interesting. "Balance at block X" type of method... I'll open an issue and we can look at how best to add this. |
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
I made some non-blocking comments.
|
Overall LGTM and +1 on Mammal's comments. |
8a3791d
to
a41ff14
Compare
All comments addressed. @ValuedMammal I considered In that sense I thought the field unclear; "net" change? Is that different than other change? etc. Here the word change would be used as meaning "the change in the wallet's balance", but it's not obvious at first read of a struct that handles sent/received values and whatnot. You might think it's just a trio of "what was sent", "what was received", "what was change" (even thought that's weird and doesn't make a lot of sense). In any case I decided against using change here and took "delta" from @matthiasdebernardini (thanks for the idea!). |
a41ff14
to
3cd8921
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.
tACK 3cd8921
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.
utACK 3cd8921
Fixes #100.
The
TxDetails
feature was put aside to focus on the 1.0 release, but now that we're done with that I want to revive the idea.This is very much WIP. I'm trying to figure out exactly what we want in this data structure, and I'm not even sure my way to get at the data is the most efficient way to do it.
Notes to the reviewers
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes: