Closed tbinetruy closed 2 years ago
Hey!
You need to pass additional flag:
.pack(legacy=True)
This is from the times before combs, tezos-client does packing with backward compatibility so that things like e.g. big map key hashes remain the same.
Ah niiice, thank you so much :)
Currently, it seems like
pytezos.michelson.micheline.PairType.pack
does not byte-pack like a tezos node would for nested pairs.Example:
Using the
tezos-client
however, we get a different value:And indeed, the
tezos-client
cli byte-unpacks the pytezos result as a sequence:Whereas it does byte-unpack its result as the expected nested pair:
Unfortunately this proves to be problematic when wanting to verify on-chain data that was signed on a Pytezos byte-pack output.
Is there anyway to get the output that
tezos-client
gives when byte-packing nested pairs using Pytezos? If not, how can I help contributing with a fix? The codebase for the byte-packing looks quite tough :)Thanks!
P.S. As a side note, byte packing a pair does result in the same output between Pytezos and the Tezos CLI:
And: