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:
Jaco Greeff
2018-09-27 12:42:20 +02:00
committed by GitHub
parent 79860b6b30
commit 773358195a
54 changed files with 825 additions and 142 deletions
@@ -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']);
});
});