UNPKG

520 BJavaScriptView Raw
1import { Struct } from '@polkadot/types-codec';
2import { UNMASK_VERSION } from './constants.js';
3/**
4 * @name GenericExtrinsicUnknown
5 * @description
6 * A default handler for extrinsics where the version is not known (default throw)
7 */
8export class GenericExtrinsicUnknown extends Struct {
9 constructor(registry, _value, { isSigned = false, version = 0 } = {}) {
10 super(registry, {});
11 throw new Error(`Unsupported ${isSigned ? '' : 'un'}signed extrinsic version ${version & UNMASK_VERSION}`);
12 }
13}