text: "use strict";
  
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  
  var _Decorated = _interopRequireDefault(require("@polkadot/metadata/Decorated"));
  
  var _Metadata = _interopRequireDefault(require("@polkadot/metadata/Metadata"));
  
  var _static = _interopRequireDefault(require("@polkadot/metadata/Metadata/v11/static"));
  
  var _create = require("../create");
  
  var _StorageKey = _interopRequireDefault(require("./StorageKey"));
  
  // Copyright 2017-2020 @polkadot/types authors & contributors
  // SPDX-License-Identifier: Apache-2.0
  describe('StorageKey', () => {
    const registry = new _create.TypeRegistry();
    describe('with MetadataV11', () => {
      const metadata = new _Metadata.default(registry, _static.default);
      registry.setMetadata(metadata);
      const decorated = new _Decorated.default(registry, metadata);
      it('should allow decoding of a DoubleMap key', () => {
        const key = new _StorageKey.default(registry, '0x5f3e4907f716ac89b6347d15ececedca8bde0a0ea8864605e3b68ed9cb2da01b66ccada06515787c10000000e535263148daaf49be5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f');
        key.setMeta(decorated.query.staking.erasStakers.meta);
        expect(key.toHuman()).toEqual(['16', '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY']);
      });
      it('should allow decoding of a Map key', () => {
        const key = new _StorageKey.default(registry, '0x426e15054d267946093858132eb537f191ca57b0c4b20b29ae7e99d6201d680cc906f7710aa165d62c709012f807af8fc3f0d2abb0c51ca9a88d4ef24d1a092bf89dacf5ce63ea1d');
        key.setMeta(decorated.query.society.defenderVotes.meta);
        expect(key.toHuman()).toEqual(['5D4yQHKfqCQYThhHmTfN1JEDi47uyDJc1xg9eZfAG1R7FC7J']);
      });
    });
  });