Expand Digest for asAura, use in HeaderExtended (#832)

This commit is contained in:
Jaco Greeff
2019-05-27 15:45:50 +12:00
committed by ian.he
parent e4371684b6
commit 73a184ec7d
3 changed files with 73 additions and 7 deletions
+13 -3
View File
@@ -6,8 +6,8 @@ import ApiPromise from '@plugnet/api/promise/Api';
import { BlockNumber } from '@plugnet/types';
import { WsProvider } from '@plugnet/rpc-provider';
const WS_LOCAL = 'ws://127.0.0.1:9944/';
// const WS_POC3 = 'wss://poc3-rpc.polkadot.io/';
// const WS = 'ws://127.0.0.1:9944/';
const WS = 'wss://poc3-rpc.polkadot.io/';
describe.skip('derive e2e', () => {
let api: ApiPromise;
@@ -17,7 +17,7 @@ describe.skip('derive e2e', () => {
});
beforeEach(async (done) => {
api = await ApiPromise.create(new WsProvider(WS_LOCAL));
api = await ApiPromise.create(new WsProvider(WS));
done();
});
@@ -29,4 +29,14 @@ describe.skip('derive e2e', () => {
expect((block1 as BlockNumber).eq(block2)).toBe(false);
});
it('subscribes to newHead, retrieving the actual validator', (done) => {
return api.derive.chain.subscribeNewHead(({ author }) => {
console.error('author', author.toString());
if (author) {
done();
}
});
});
});