"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _Struct = _interopRequireDefault(require("../../codec/Struct"));

var _constants = require("./constants");

// Copyright 2017-2019 @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.

/**
 * @name ExtrinsicUnknown
 * @description
 * A default handler for extrinsics where the version is not known (default throw)
 */
class ExtrinsicUnknown extends _Struct.default {
  constructor(value) {
    let {
      isSigned = false,
      version = 0
    } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    super({});
    throw new Error("Unsupported ".concat(isSigned ? '' : 'un', "signed extrinsic version ").concat(version & _constants.UNMASK_VERSION));
  }

}

exports.default = ExtrinsicUnknown;