Convert all type/* (and some primitives) to srml/* (#1189)

* Convert (almost-all) non-primitives (and some primitives) to srml/*

* Move Vote to primitives, remove type folder

* Move Balance :-o

* Fixup tests, override Balance.toRaw()
This commit is contained in:
Jaco Greeff
2019-07-25 16:34:47 +02:00
committed by GitHub
parent 6d65095ee0
commit 39323a8896
112 changed files with 489 additions and 794 deletions
+3 -2
View File
@@ -3,6 +3,7 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { ISubmittableResult, SubmittableResult } from '@polkadot/api/SubmittableExtrinsic';
import { Hash } from '@polkadot/types/srml/types';
import { IKeyringPair } from '@polkadot/types/types';
import { ContractABI } from './types';
@@ -10,7 +11,7 @@ import BN from 'bn.js';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiRx } from '@polkadot/api';
import { AccountId, Address, Hash } from '@polkadot/types';
import { createType, AccountId, Address } from '@polkadot/types';
import Abi from './Abi';
import RxBase from './RxBase';
@@ -39,7 +40,7 @@ export default class Blueprint extends RxBase {
public constructor (api: ApiRx, abi: ContractABI | Abi, codeHash: string | Hash) {
super(api, abi);
this.codeHash = new Hash(codeHash);
this.codeHash = createType('Hash', codeHash);
}
public deployContract (endowment: number | BN, maxGas: number | BN, ...params: any[]): BlueprintCreate {
+2 -1
View File
@@ -3,6 +3,7 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { ISubmittableResult, SubmittableResult } from '@polkadot/api/SubmittableExtrinsic';
import { Hash } from '@polkadot/types/srml/types';
import { IKeyringPair } from '@polkadot/types/types';
import { ContractABI } from './types';
@@ -10,7 +11,7 @@ import BN from 'bn.js';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiRx } from '@polkadot/api';
import { AccountId, Address, Hash } from '@polkadot/types';
import { AccountId, Address } from '@polkadot/types';
import { compactAddLength, u8aToU8a } from '@polkadot/util';
import Abi from './Abi';