fix: replace node buffers with uint8arrays (#180)

* fix: replace node buffers with uint8arrays

All usage of node buffers have been replaced with uint8arrays.

BREAKING CHANGES:

- Where node Buffers were returned, now Uint8Arrays are

* chore: remove commented code
This commit is contained in:
Alex Potsides
2020-08-07 15:23:02 +01:00
committed by GitHub
parent 8b3dc56dc2
commit a0f387aeab
35 changed files with 344 additions and 349 deletions

View File

@ -9,6 +9,7 @@ chai.use(dirtyChai)
const crypto = require('../src')
const fixtures = require('./fixtures/go-key-rsa')
const { expectErrCode } = require('./util')
const uint8ArrayEquals = require('uint8arrays/equals')
/** @typedef {import("libp2p-crypto").PrivateKey} PrivateKey */
@ -83,7 +84,7 @@ describe('libp2p-crypto', function () {
it('unmarshal -> marshal, public key', () => {
const key = crypto.keys.unmarshalPublicKey(fixtures.public.key)
const marshalled = crypto.keys.marshalPublicKey(key)
expect(fixtures.public.key.equals(marshalled)).to.eql(true)
expect(uint8ArrayEquals(fixtures.public.key, marshalled)).to.eql(true)
})
})