Skip to content
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

Fix reward inherent hashes #2475

Merged
merged 1 commit into from
May 17, 2024
Merged

Fix reward inherent hashes #2475

merged 1 commit into from
May 17, 2024

Conversation

hrxi
Copy link
Contributor

@hrxi hrxi commented May 16, 2024

The wrong hash function was used, instead tx_hash is correct.

Fixes #2408.

Comment on lines -661 to +667
validator_address,
reward_address,
ref validator_address,
ref reward_address,
value,
}) => Inherent::Reward {
block_number: hist_tx.block_number,
block_time: hist_tx.block_time,
validator_address,
target: reward_address,
validator_address: validator_address.clone(),
target: reward_address.clone(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is cloning better than using ref?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to move the .tx_hash() into the branch, but that requires the full object without moving stuff out. Since Address is just 20 bytes, cloning doesn't do much work here anyway.

@jsdanielh jsdanielh force-pushed the hrxi/reward_inherent_hash branch from e273640 to 386c4f5 Compare May 17, 2024 01:00
The wrong hash function was used, instead `tx_hash` is correct.

Fixes #2408.
@jsdanielh jsdanielh force-pushed the hrxi/reward_inherent_hash branch from 386c4f5 to d1e17ef Compare May 17, 2024 01:01
@jsdanielh jsdanielh merged commit d1e17ef into albatross May 17, 2024
6 checks passed
@jsdanielh jsdanielh deleted the hrxi/reward_inherent_hash branch May 17, 2024 01:44
@jsdanielh jsdanielh added this to the Nimiq PoS Mainnet milestone May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rpc call doesn't work for Reward transaction
4 participants