-
Notifications
You must be signed in to change notification settings - Fork 72
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
Don't default-initialize RPC Transaction
type
#2470
Conversation
I'd expect the |
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.
Works! I see correct tx hashes and can query the txs by those hashes as well! 👍
Instead, try to find a sensible value for each field. Previously, the hash was zero-initialized, for example. Fixes #2465.
c7cbfdc
to
397c7fe
Compare
block_number: Some(macro_block.block_number()), | ||
timestamp: Some(macro_block.timestamp()), | ||
confirmations: cur_block_height.map(|h| h - macro_block.block_number()), | ||
from: Address::default(), |
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 missed this in the review, but you changed the sender from the Policy::COINBASE_ADDRESS
to Address::default()
, which are different addresses.
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 fixed it in de902e5.
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 should have alerted you to this, sorry. Is there a reason to prefer the all-zeros address over the coinbase address? As far as I understood it, the COINBASE
address is the one where new coins come from?
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 don't understand the question, did you switch the address names in your second sentence?
This code here is converting reward inherents into transactions, so of course the tx should have the coinbase as sender.
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.
Actually, I just found this:
pub fn into_transaction(self) -> Result<ExecutedTransaction, IntoTransactionError> { |
Can't we use that method here?
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.
Woops, you changed it back to COINBASE
because I accidentally changed it to the all-zeros address. I got confused. Thanks for fixing it.
It was changed to the wrong address in #2470.
Instead, try to find a sensible value for each field. Previously, the hash was zero-initialized, for example.
Fixes #2465.