"use strict";
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Struct_1 = __importDefault(require("../../codec/Struct"));
const constants_1 = require("./constants");
/**
 * @name GenericExtrinsicUnknown
 * @description
 * A default handler for extrinsics where the version is not known (default throw)
 */
class ExtrinsicUnknown extends Struct_1.default {
    constructor(registry, value, { isSigned = false, version = 0 } = {}) {
        super(registry, {});
        throw new Error(`Unsupported ${isSigned ? '' : 'un'}signed extrinsic version ${version & constants_1.UNMASK_VERSION}`);
    }
}
exports.default = ExtrinsicUnknown;
