decentralized-identity / decentralized-identity/sidetree

Test Vectors for Filesystem

Open
#861 1 comment 1 reaction 0 assignees View on GitHub
Spec v1.1 test vectors
Dominant language
HTML
Stars
438
Forks
115
PR merge metrics
No merged PRs in 30d

Description

When SIP-1 is supported, test vectors for the entire filesystem should be created... especially so we can ensure that IPFS identifiers for compressed files are stable / portable across implementations.... Preliminary testing of `zlib` worries me, suggest picking an implementation that can run in browsers and that has stable test vectors.... like https://www.npmjs.com/package/pako

https://github.com/decentralized-identity/sidetree/blob/6dad5bf7f99851638d99cfa0aeb53afd0d550869/tests/core/util/Compressor.spec.ts

This test does not compare compressed buffer to static hash... this just tests that you can compress and decompress.

The test should look like this.

```ts
const testDataObject:any = require('./test-data.json');
const compressed = Compressor.cannonizeAndCompress(testDataObject);
const digest = sha256(compressed);
expect(digest).toBe(require('./test-data-expected-digest'))
```

This way GoLang, Rust and other TypeScript implementations can make sure they compress to the exact same binary.... other wise you will see lots of IPFS hashes which are only decompress-able with certain implementations.... which will cause the did method to be perceived as unreliable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.