Closed papag00se closed 11 months ago
I believe this is related to https://github.com/Hyperion-BT/helios/issues/92
This is indeed related to #92, possibly not caught then because @lley154 was using token names of the same length.
I'll add a new static method to ByteArrayData
called compLengthFirst
.
Note: the current comp
is also used for the UPLC builtins lessThanByteString
and lessThanEqualsByteString
, which is implemented according to the spec, which specifically gives an example of a bytestring longer than another sorting first (#23456789 < #24
).
v0.16.4 hopefully does this correctly
Fixed!
Hardware wallets like Ledger and Trezor reconstruct the transaction when signing. When they do this, the assets end up sorted differently than the Helios sort. When submitting a transaction that has multiple assets listed within a policy, hardware wallets fail because they produce a different txhash.
According to the CBOR spec, length should be considered first, then lexical order.
When we replace the code in
ByteArrayData.comp
with the following code, the hardware wallet transactions are successful: