Repair lexicographic ordering among Bytes instances, which in turn repairs canonicalizing binary output, which in turn fixes the tests now there's just been a very long test name symbol added.
This commit is contained in:
parent
850678a80a
commit
2721ce81c4
|
@ -160,6 +160,11 @@ export class Bytes implements Preservable<never> {
|
|||
return nibbles.join('');
|
||||
}
|
||||
|
||||
valueOf(): string {
|
||||
// Defined mostly in order to get lexicographic comparison to "work reliably"
|
||||
return this.toHex();
|
||||
}
|
||||
|
||||
[PreserveOn](encoder: Encoder<never>) {
|
||||
encoder.state.emitbyte(Tag.ByteString);
|
||||
encoder.state.varint(this.length);
|
||||
|
|
|
@ -26,6 +26,8 @@ describe('reading common test suite', () => {
|
|||
includeAnnotations: true,
|
||||
canonical: true,
|
||||
}));
|
||||
// console.log('original', new Bytes(samples_bin).toHex());
|
||||
// console.log('reencoded', new Bytes(bs).toHex());
|
||||
expect(bs).toEqual(new Uint8Array(samples_bin));
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue