Skip to content

Commit

Permalink
chore: use CarBufferReader from @ipld/car
Browse files Browse the repository at this point in the history
Remove sync car reader code that has moved upstream into [@ipld/car](ipld/js-car#121 (comment))

Fixes #401

License: MIT
Signed-off-by: Oli Evans <[email protected]>
  • Loading branch information
olizilla committed Feb 8, 2023
1 parent 99cbd2f commit c9b7921
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 641 deletions.
2 changes: 1 addition & 1 deletion packages/access-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"dist/src/**/*.d.ts.map"
],
"dependencies": {
"@ipld/car": "^5.0.3",
"@ipld/car": "^5.1.0",
"@ipld/dag-cbor": "^9.0.0",
"@ipld/dag-ucan": "^3.2.0",
"@ucanto/client": "^4.2.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/access-client/src/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @module
*/
/* eslint-disable unicorn/prefer-spread */
import { CarReader } from './utils/car-reader-sync.js'
import { CarBufferReader } from '@ipld/car/buffer-reader'
import * as CarBufferWriter from '@ipld/car/buffer-writer'
import { Delegation } from '@ucanto/core/delegation'
import * as u8 from 'uint8arrays'
Expand Down Expand Up @@ -72,7 +72,7 @@ export function bytesToDelegations(bytes) {
if (!(bytes instanceof Uint8Array) || bytes.length === 0) {
throw new TypeError('Input should be a non-empty Uint8Array.')
}
const reader = CarReader.fromBytes(bytes)
const reader = CarBufferReader.fromBytes(bytes)
const roots = reader.getRoots()

/** @type {Types.Delegation<T>[]} */
Expand Down
97 changes: 0 additions & 97 deletions packages/access-client/src/utils/car-header-validator.js

This file was deleted.

Loading

0 comments on commit c9b7921

Please sign in to comment.