Round out metadata types (#169)
* Fake Origin for compatibility * Add Gas * Add Moment * Cleanups * NewAccountOutcome * Permill & Perbill * PrendingExtrinsics -> PendingExtrinsics * Extrinsics & PendingExtrinsics * Alias String -> Text (as found in jsonrpc, expose it) * MetaDate -> Metadata (compat) * Add StorageData, StorageKey & ChangeSet * Cleanup comments * Comment update * Comment typo * Add ParachainId * Add Tuple type * Tuple tests * Clenaup Tuple generics * Expand comment * Expose keys/values on struct * Array-like at -> get * Cleanup & simplify EnumType * Use setValue internally to fromU8a * Add RuntimeVersion * Expose RuntimeVersion
This commit is contained in:
@@ -31,4 +31,18 @@ describe('Struct', () => {
|
||||
baz: 'U32'
|
||||
});
|
||||
});
|
||||
|
||||
it('exposes the keys/values', () => {
|
||||
const test = new Struct({
|
||||
foo: Text,
|
||||
bar: U32
|
||||
}, { foo: 'bazzing', bar: 69 });
|
||||
|
||||
expect(test.keys()).toEqual(['foo', 'bar']);
|
||||
expect(
|
||||
test.values().map((v) =>
|
||||
v.toString()
|
||||
)
|
||||
).toEqual(['bazzing', '0x00000045']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user