dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Set stake_modifier + functional tests for it #974

Closed scravy closed 5 years ago

scravy commented 5 years ago

The stake_modifier for a block is saved in CBlockIndex and it was not set before. This pull request changes that.

Updated the functional tests such that the snapshot hash calculation correctly takes stake_modifier into account. Notable change: Instead of passing snapshot_meta.hash it passes snapshot_meta which harbours both hash and stake_modifier.

Signed-off-by: Julian Fleischer julian@thirdhash.com

castarco commented 5 years ago

I think feature_block might be failing as the snapshot hash incorporates the stake modifier and I'm not sure the calculation is correct right now. I am running functional tests right now.

~As far as I can tell, the snapshot hashes were correctly computed. At almost every step they are checked, and those assertions pass... although I'll look closer to see if the assertions are not "good enough".~ :man_facepalming: I said nothing.

AM5800 commented 5 years ago

Concept ACK I lack experience in the topic. But it looks correct to me. Especially I like the test that check that stake_modifier is not zero

scravy commented 5 years ago

rebased, squashed, + force pushed

scravy commented 5 years ago

@castarco I'll follow up on that set-literal foreach comprehension in a follow-up PR :-)