Move Event, Address, AccountId, AccountIndex to generic (#1202)

* Move Event, Address, AccountId, AccountIndex to generic

* Move AccountId, AccountIndex, Address & Event to generic

* Move Vote
This commit is contained in:
Jaco Greeff
2019-07-26 16:39:28 +02:00
committed by GitHub
parent 894f07e3c9
commit 02cd1331aa
69 changed files with 247 additions and 246 deletions
+2 -2
View File
@@ -3,7 +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/interfaces';
import { AccountId, Address, Hash } from '@polkadot/types/interfaces';
import { IKeyringPair } from '@polkadot/types/types';
import { ContractABI } from './types';
@@ -11,7 +11,7 @@ import BN from 'bn.js';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiRx } from '@polkadot/api';
import { createType, AccountId, Address } from '@polkadot/types';
import { createType } from '@polkadot/types';
import Abi from './Abi';
import RxBase from './RxBase';
+1 -2
View File
@@ -3,7 +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/interfaces';
import { AccountId, Address, Hash } from '@polkadot/types/interfaces';
import { IKeyringPair } from '@polkadot/types/types';
import { ContractABI } from './types';
@@ -11,7 +11,6 @@ import BN from 'bn.js';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ApiRx } from '@polkadot/api';
import { AccountId, Address } from '@polkadot/types';
import { compactAddLength, u8aToU8a } from '@polkadot/util';
import Abi from './Abi';
+4 -4
View File
@@ -2,15 +2,15 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { ContractABI, ContractABIFn, InterfaceContract, InterfaceContractCalls } from './types';
import { AccountId, Address } from '@polkadot/types/interfaces';
import { IKeyringPair } from '@polkadot/types/types';
import { ContractABI, ContractABIFn, InterfaceContract, InterfaceContractCalls } from './types';
import BN from 'bn.js';
import { Observable } from 'rxjs';
import { ApiRx } from '@polkadot/api';
import { SubmittableResult } from '@polkadot/api/SubmittableExtrinsic';
import { AccountId, Address } from '@polkadot/types';
import { createType } from '@polkadot/types';
import Abi from './Abi';
import RxBase from './RxBase';
@@ -31,7 +31,7 @@ export default class RxContract extends RxBase implements InterfaceContract {
public constructor (api: ApiRx, abi: ContractABI | Abi, address: string | AccountId | Address) {
super(api, abi);
this.address = new Address(address);
this.address = createType('Address', address);
Object.entries(abi.messages).forEach(([name]): void => {
this.calls[name] = (fn: ContractABIFn): CallResult =>
+1 -1
View File
@@ -3,10 +3,10 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { SubmittableModuleExtrinsics } from '@polkadot/api/types';
import { Address } from '@polkadot/types/interfaces';
import { CodecArg } from '@polkadot/types/types';
import { ApiPromise, ApiRx } from '@polkadot/api';
import { Address } from '@polkadot/types';
export type ApiObject<ApiType> = ApiType extends 'rxjs'
? ApiRx