Acc contracts_getStorage (#1603)

This commit is contained in:
Jaco Greeff
2019-11-23 22:29:33 +01:00
committed by GitHub
parent 49b3104d04
commit db59fbff25
9 changed files with 62 additions and 39 deletions
+4 -4
View File
@@ -12,7 +12,7 @@ import createParam from './create/param';
const getHeader: RpcMethodOpt = {
description: 'Retrieves the header for a specific block',
params: [
createParam('hash', 'Hash', { isOptional: true })
createParam('hash', 'BlockHash', { isOptional: true })
],
type: 'Header'
};
@@ -20,7 +20,7 @@ const getHeader: RpcMethodOpt = {
const getBlock: RpcMethodOpt = {
description: 'Get header and body of a relay chain block',
params: [
createParam('hash', 'Hash', { isOptional: true })
createParam('hash', 'BlockHash', { isOptional: true })
],
type: 'SignedBlock'
};
@@ -30,13 +30,13 @@ const getBlockHash: RpcMethodOpt = {
params: [
createParam('blockNumber', 'BlockNumber', { isOptional: true })
],
type: 'Hash'
type: 'BlockHash'
};
const getFinalizedHead: RpcMethodOpt = {
description: 'Get hash of the last finalized block in the canon chain',
params: [],
type: 'Hash'
type: 'BlockHash'
};
const subscribeNewHeads: RpcMethodOpt = {
+14 -2
View File
@@ -14,11 +14,22 @@ const call: RpcMethodOpt = {
isOptional: true,
params: [
createParam('callRequest', 'ContractCallRequest'),
createParam('at', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
],
type: 'ContractExecResult'
};
const getStorage: RpcMethodOpt = {
description: 'Returns the value under a specified storage key in a contract',
isOptional: true,
params: [
createParam('address', 'AccountId'),
createParam('key', 'H256'),
createParam('at', 'BlockHash', { isOptional: true })
],
type: 'Option<Bytes>'
};
const section = 'contracts';
/**
@@ -30,6 +41,7 @@ export default {
description: '(Optional) Methods that performs actions on contracts',
section,
methods: {
call: createMethod(section, 'call', call)
call: createMethod(section, 'call', call),
getStorage: createMethod(section, 'getStorage', getStorage)
}
};
+2 -1
View File
@@ -11,9 +11,10 @@ import createParam from './create/param';
const queryInfo: RpcMethodOpt = {
description: 'Retrieves the fee information for an encoded extrinsic',
isOptional: true,
params: [
createParam('extrinsic', 'Bytes'),
createParam('hash', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
],
type: 'RuntimeDispatchInfo'
};
+6 -6
View File
@@ -14,14 +14,14 @@ const call: RpcMethodOpt = {
params: [
createParam('method', 'Text'),
createParam('data', 'Bytes'),
createParam('block', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
],
type: 'Bytes'
};
const KEY_QUERY_PARAMS = [
createParam('key', 'StorageKey'),
createParam('block', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
];
const getKeys: RpcMethodOpt = {
@@ -51,7 +51,7 @@ const getStorageSize: RpcMethodOpt = {
const CHILD_QUERY_PARAMS = [
createParam('childStorageKey', 'StorageKey'),
createParam('key', 'StorageKey'),
createParam('block', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
];
const getChildKeys: RpcMethodOpt = {
@@ -81,7 +81,7 @@ const getChildStorageSize: RpcMethodOpt = {
const getMetadata: RpcMethodOpt = {
description: 'Returns the runtime metadata',
params: [
createParam('block', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
],
// This is not part of InterfaceTypes
type: 'Metadata' as any
@@ -90,7 +90,7 @@ const getMetadata: RpcMethodOpt = {
const getRuntimeVersion: RpcMethodOpt = {
description: 'Get the runtime version',
params: [
createParam('hash', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
],
type: 'RuntimeVersion'
};
@@ -100,7 +100,7 @@ const queryStorage: RpcMethodOpt = {
params: [
createParam('keys', 'Vec<StorageKey>'),
createParam('startBlock', 'Hash'),
createParam('block', 'Hash', { isOptional: true })
createParam('at', 'BlockHash', { isOptional: true })
],
type: 'Vec<StorageChangeSet>'
};