"use strict";
// Copyright 2017-2020 @polkadot/metadata 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 util_1 = require("@polkadot/util");
const U32_1 = __importDefault(require("../../types/primitive/U32"));
exports.MAGIC_NUMBER = 0x6174656d; // `meta`, reversed for Little Endian encoding
class MagicNumber extends U32_1.default {
    constructor(registry, value) {
        super(registry, value);
        const magic = new U32_1.default(registry, exports.MAGIC_NUMBER);
        util_1.assert(this.eq(magic), `MagicNumber mismatch: expected ${magic.toHex()}, found ${this.toHex()}`);
    }
}
exports.default = MagicNumber;
