fix(primitives): Fix decoding of empty Nonce hash (#67)

This commit is contained in:
Santiago Carmuega 2022-03-01 09:42:08 -03:00 committed by GitHub
parent 3b9c81e6a0
commit 90dfecd283
3 changed files with 10 additions and 7 deletions

View file

@ -99,7 +99,7 @@ pub struct Nonce {
pub variant: NonceVariant,
#[n(1)]
pub hash: Hash<32>,
pub hash: Option<Hash<32>>,
}
pub type ScriptHash = ByteVec;
@ -1424,6 +1424,8 @@ mod tests {
include_str!("test_data/test15.block"),
// peculiar block with protocol update values
include_str!("test_data/test16.block"),
// peculiar block with missing nonce hash
include_str!("test_data/test17.block"),
];
for (idx, block_str) in test_blocks.iter().enumerate() {

File diff suppressed because one or more lines are too long