You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
import { versionedHashVersionKzg } from '../constants/kzg.js';
|
|
import { BaseError } from './base.js';
|
|
export class BlobSizeTooLargeError extends BaseError {
|
|
constructor({ maxSize, size }) {
|
|
super('Blob size is too large.', {
|
|
metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size} bytes`],
|
|
name: 'BlobSizeTooLargeError',
|
|
});
|
|
}
|
|
}
|
|
export class EmptyBlobError extends BaseError {
|
|
constructor() {
|
|
super('Blob data must not be empty.', { name: 'EmptyBlobError' });
|
|
}
|
|
}
|
|
export class InvalidVersionedHashSizeError extends BaseError {
|
|
constructor({ hash, size, }) {
|
|
super(`Versioned hash "${hash}" size is invalid.`, {
|
|
metaMessages: ['Expected: 32', `Received: ${size}`],
|
|
name: 'InvalidVersionedHashSizeError',
|
|
});
|
|
}
|
|
}
|
|
export class InvalidVersionedHashVersionError extends BaseError {
|
|
constructor({ hash, version, }) {
|
|
super(`Versioned hash "${hash}" version is invalid.`, {
|
|
metaMessages: [
|
|
`Expected: ${versionedHashVersionKzg}`,
|
|
`Received: ${version}`,
|
|
],
|
|
name: 'InvalidVersionedHashVersionError',
|
|
});
|
|
}
|
|
}
|
|
//# sourceMappingURL=blob.js.map
|