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!: header consensus #4527

Merged

Conversation

SWvheerden
Copy link
Collaborator

@SWvheerden SWvheerden commented Aug 23, 2022

Description

Fix header consensus encoding

How Has This Been Tested?

@sdbondi
Copy link
Member

sdbondi commented Aug 24, 2022

You'll also need to update the tari_miner_helper consensus change test.

Bonus: change the consensus decoding code

// From this
FixedHash::from(<[u8; 32] as ConsensusDecoding>::consensus_decode(reader)?);
// to this
FixedHash::consensus_decode(reader)?;

@SWvheerden
Copy link
Collaborator Author

Thanks,
but no, tari_miner_helper consensus change test is correct as of #4522

@sdbondi
Copy link
Member

sdbondi commented Aug 24, 2022

I suggest adding a test for header consensus encoding

#[test]
fn consensus_encoding() {
 let consensus_constants = ConsensusConstantsBuilder::new(Network::Esmeralda)
        .build();
   let header = BlockHeader::new(consensus_constants.blockchain_version);
   check_consensus_encoding_correctness(header).unwrap();
}

@SWvheerden
Copy link
Collaborator Author

I suggest adding a test for header consensus encoding

#[test]
fn consensus_encoding() {
 let consensus_constants = ConsensusConstantsBuilder::new(Network::Esmeralda)
        .build();
   let header = BlockHeader::new(consensus_constants.blockchain_version);
   check_consensus_encoding_correctness(header).unwrap();
}

yeah, will add one in the next pr

@hansieodendaal
Copy link
Contributor

Thanks, these slipped me by with the latest commit in #4522

@stringhandler stringhandler merged commit 3f5fcf2 into tari-project:development Aug 24, 2022
@SWvheerden SWvheerden deleted the sw_fix_header_consensus branch August 31, 2022 06:17
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.

4 participants