Add payment queryInfo RPC (#1580)

This commit is contained in:
Jaco Greeff
2019-11-18 12:26:09 +01:00
committed by GitHub
parent dde7d49598
commit 75220eb54f
11 changed files with 79 additions and 6 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ describe('Api', (): void => {
Object.keys(rpc).filter((key): boolean => !key.startsWith('_'))
).toEqual([
'provider', 'mapping', 'sections',
'account', 'author', 'chain', 'contracts', 'rpc', 'state', 'system'
'account', 'author', 'chain', 'contracts', 'payment', 'rpc', 'state', 'system'
]);
});
+2
View File
@@ -86,6 +86,8 @@ export default class Rpc implements RpcInterface {
public readonly contracts!: RpcInterface['contracts'];
public readonly payment!: RpcInterface['payment'];
public readonly rpc!: RpcInterface['rpc'];
public readonly state!: RpcInterface['state'];
+4 -1
View File
@@ -6,7 +6,7 @@ import { Vec } from '@polkadot/types/codec';
import { Bytes, Metadata, StorageData, StorageKey, Text, u64 } from '@polkadot/types';
import { AccountId, BlockNumber, Extrinsic, Hash, Header, Index, SignedBlock } from '@polkadot/types/interfaces/runtime';
import { ContractCallRequest, ContractExecResult } from '@polkadot/types/interfaces/contracts';
import { ChainProperties, ExtrinsicOrHash, ExtrinsicStatus, Health, NetworkState, PeerInfo, RpcMethods, RuntimeVersion, StorageChangeSet } from '@polkadot/types/interfaces/rpc';
import { ChainProperties, ExtrinsicOrHash, ExtrinsicStatus, Health, NetworkState, PeerInfo, RpcMethods, RuntimeDispatchInfo, RuntimeVersion, StorageChangeSet } from '@polkadot/types/interfaces/rpc';
import { Codec, IExtrinsic } from '@polkadot/types/types';
export interface RpcInterface {
@@ -32,6 +32,9 @@ export interface RpcInterface {
contracts: {
call(callRequest: ContractCallRequest, at?: Hash | Uint8Array | string): Observable<ContractExecResult>;
};
payment: {
queryInfo(extrinsic: Bytes | Uint8Array | string, hash?: Hash | Uint8Array | string): Observable<RuntimeDispatchInfo>;
};
rpc: {
methods(): Observable<RpcMethods>;
};