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
@@ -13,27 +13,6 @@ describe.skip('e2e basics', () => {
api = new Api(new Ws('ws://127.0.0.1:9944'));
});
it('subscribes to chain_newHead', (done) => {
let count = 0;
// tslint:disable-next-line
api.chain
.newHead((error, data) => {
if (error) {
return done(error);
}
expect(data).toBeDefined();
if (++count === 3) {
done();
}
})
.then((subscriptionId) => {
console.log('newHead: subscriptionId =', subscriptionId);
});
});
it('retrieves the pending extrinsics', () => {
return api.author
.pendingExtrinsics()
@@ -0,0 +1,49 @@
// Copyright 2017-2018 @polkadot/api-provider authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import Api from '../../api/src';
import Ws from '../src/ws';
describe.skip('e2e chain', () => {
let api;
beforeEach(() => {
jest.setTimeout(30000);
api = new Api(new Ws('ws://127.0.0.1:9944'));
});
it('subscribes to chain_newHead', (done) => {
let count = 0;
// tslint:disable-next-line
api.chain
.newHead((error, data) => {
if (error) {
return done(error);
}
expect(data).toBeDefined();
if (++count === 3) {
done();
}
})
.then((subscriptionId) => {
console.log('newHead: subscriptionId =', subscriptionId);
});
});
it('retrieves the runtime version', () => {
return api.chain
.getRuntimeVersion()
.then((version) => {
console.error('version', version);
})
.catch((error) => {
console.error(error);
throw error;
});
});
});