pontem-types-bundle
Version:
Bundled types to instantiate the Polkadot JS api with a Pontem network
50 lines (49 loc) • 1.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("./index");
const fields = [
'AuthorId',
'Balance',
'Bond',
'Candidate',
'Collator2',
'CollatorSnapshot',
'ExitQ',
'InflationInfo',
'MoveStructTag',
'MoveTypeTag',
'Nominator',
'Nominator2',
'NominatorAdded',
'OrderedSet',
'ParachainBondConfig',
'Range',
'RangeBalance',
'RangePerbill',
'RegistrationInfo',
'RoundIndex',
'RoundInfo',
'ValidatorStatus',
];
describe('Pontem Definitions', () => {
test('Pontem Snapshot', () => {
expect(index_1.pontemDefinitions).toMatchSnapshot();
});
test('Pontem Types', () => {
expect(index_1.pontemDefinitions).toBeInstanceOf(Object);
expect(index_1.pontemDefinitions).toHaveProperty('types');
const types = index_1.pontemDefinitions.types;
expect(types).toBeInstanceOf(Array);
expect(types.length).toBeGreaterThan(0);
const type = types[0];
expect(type).toHaveProperty('minmax');
expect(type.minmax).toBeInstanceOf(Array);
expect(type.minmax.length).toBe(2);
expect(type).toHaveProperty('types');
expect(type.types).toBeInstanceOf(Object);
for (const field of fields) {
expect(type.types).toHaveProperty(field);
expect(type.types[field]).toBeTruthy();
}
});
});