BP-WG / bp-core

BP Core Lib: consensus data structures and client-side-validation library for bitcoin protocol
Apache License 2.0
23 stars 20 forks source link

Baid58 parse to TapretCommitment not work #37

Closed crisdut closed 1 year ago

crisdut commented 1 year ago

Hi @dr-orlovsky,

I tried use baid58 parse to TapretCommitment and received the follow error:

running 1 test
thread 'tapret::tapscript::test::commiment_serialization' panicked at 'exact size match: Decode(Io(Kind(InvalidInput)))', dbc/src/tapret/tapscript.rs:66:10

Test Code

#[test]
pub fn tapret_commitment_baid58() {
    let commitment = commitment();
    let _ =  TapretCommitment::from_baid58(commitment.to_baid58()).unwrap();
}
dr-orlovsky commented 1 year ago

This was caused by a bug in strict encoding: https://github.com/strict-types/strict-encoding/pull/13

Fixed in #39