@@ -7,9 +7,9 @@ import type { CID } from 'multiformats/cid'
77// https://github.com/multiformats/multicodec/blob/d06fc6194710e8909bac64273c43f16b56ca4c34/table.csv#L2
88const IDENTITY_CODEC = 0x00
99
10- class IdentityDigestTooLongError extends Error {
11- static name = 'IdentityDigestTooLongError '
12- name = 'IdentityDigestTooLongError '
10+ class IdentityHashDigestTooLongError extends Error {
11+ static name = 'IdentityHashDigestTooLongError '
12+ name = 'IdentityHashDigestTooLongError '
1313}
1414
1515export interface IdentityBlockstoreInit {
@@ -30,7 +30,7 @@ export class IdentityBlockstore extends BaseBlockstore {
3030 put ( key : CID , block : Uint8Array | AwaitIterable < Uint8Array > , options ?: AbortOptions ) : Await < CID > {
3131 if ( key . multihash . code === IDENTITY_CODEC ) {
3232 if ( this . maxDigestLength != null && key . multihash . digest . byteLength > this . maxDigestLength ) {
33- throw new IdentityDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
33+ throw new IdentityHashDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
3434 }
3535
3636 options ?. signal ?. throwIfAborted ( )
@@ -48,7 +48,7 @@ export class IdentityBlockstore extends BaseBlockstore {
4848 * get ( key : CID , options ?: AbortOptions ) : AwaitGenerator < Uint8Array > {
4949 if ( key . multihash . code === IDENTITY_CODEC ) {
5050 if ( this . maxDigestLength != null && key . multihash . digest . byteLength > this . maxDigestLength ) {
51- throw new IdentityDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
51+ throw new IdentityHashDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
5252 }
5353
5454 options ?. signal ?. throwIfAborted ( )
@@ -67,7 +67,7 @@ export class IdentityBlockstore extends BaseBlockstore {
6767 has ( key : CID , options ?: AbortOptions ) : Await < boolean > {
6868 if ( key . multihash . code === IDENTITY_CODEC ) {
6969 if ( this . maxDigestLength != null && key . multihash . digest . byteLength > this . maxDigestLength ) {
70- throw new IdentityDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
70+ throw new IdentityHashDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
7171 }
7272
7373 options ?. signal ?. throwIfAborted ( )
@@ -85,7 +85,7 @@ export class IdentityBlockstore extends BaseBlockstore {
8585 delete ( key : CID , options ?: AbortOptions ) : Await < void > {
8686 if ( key . code === IDENTITY_CODEC ) {
8787 if ( this . maxDigestLength != null && key . multihash . digest . byteLength > this . maxDigestLength ) {
88- throw new IdentityDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
88+ throw new IdentityHashDigestTooLongError ( `Identity digest too long - ${ key . multihash . digest . byteLength } > this.maxDigestLength` )
8989 }
9090
9191 options ?. signal ?. throwIfAborted ( )
0 commit comments