Update @polkadot/types (#105)

This commit is contained in:
Jaco Greeff
2018-06-26 11:11:43 +02:00
committed by GitHub
parent 243cd1bcc2
commit ae9fc0bd97
15 changed files with 113 additions and 113 deletions
+1 -1
View File
@@ -39,7 +39,7 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0-beta.51",
"@polkadot/storage": "^0.19.5",
"@polkadot/storage": "^0.20.1",
"@polkadot/util": "^0.24.6",
"@polkadot/util-crypto": "^0.24.6",
"@polkadot/util-keyring": "^0.24.6",
+6 -8
View File
@@ -4,7 +4,8 @@
// FIME: This file is way too long and way too messy
import { Storage$Key } from '@polkadot/storage/types';
import { Storages } from '@polkadot/storage/types';
import { SectionItem } from '@polkadot/params/types';
import { KeyringPair } from '@polkadot/util-keyring/types';
import { ProviderInterface$Emitted } from '../types';
import { MockState, MockState$Storage, MockState$Subscriptions, MockState$Subscription$Callback } from './types';
@@ -19,12 +20,9 @@ import randomAsU8a from '@polkadot/util-crypto/random/asU8a';
import testKeyring from '@polkadot/util-keyring/testing';
const keyring = testKeyring();
// @ts-ignore yes, it _should_ be there
const stateStaking = state.get('staking').public;
// @ts-ignore yes, it _should_ be there
const stateSystem = state.get('staking').public;
// @ts-ignore yes, it _should_ be there
const stateTimestamp = state.get('timestamp').public;
const stateStaking = state.staking.public;
const stateSystem = state.staking.public;
const stateTimestamp = state.timestamp.public;
const emitEvents: Array<ProviderInterface$Emitted> = ['connected', 'disconnected'];
let emitIndex = 0;
@@ -59,7 +57,7 @@ function updateSubs (subscriptions: MockState$Subscriptions, method: string, val
});
}
function setStorageBn (storage: MockState$Storage, key: Storage$Key, value: BN | number, ...keyParams: Array<Uint8Array>): void {
function setStorageBn (storage: MockState$Storage, key: SectionItem<Storages>, value: BN | number, ...keyParams: Array<Uint8Array>): void {
const keyValue = u8aToHex(
createKey(key).apply(null, keyParams)
);
+5 -5
View File
@@ -12,14 +12,14 @@ import logger from '@polkadot/util/logger';
const l =logger('api-mock');
const SUBSCRIPTIONS: string[] = Array.prototype.concat.apply(
[], [...interfaces.values()].map((areas) =>
[], Object.values(interfaces).map((area) =>
Object
.keys(areas.public)
.values(area.public)
.filter((method) =>
areas.public[method].isSubscription
method.isSubscription
)
.map((method) =>
`subscribe_${method}`
.map(({ name }) =>
`subscribe_${name}`
)
)
);