Decode runtime metadata (#162)

* WIP

* Some output, still borken...

* Events decoded correctly

* WIP, metadata decoded

* String cleanups

* Expand with generics

* Add getters

* Start docs...

* Additional docs

* Extra whitespace on Compact

* CodecLength FIXME

* Remove FIXME (impl. takes care)

* Swap in LengthCompact encoding

* Extend docs, play with auto-type for struct

* Trim strings, add Type for type-specific String

* More string-type hackery

* Don't allow Type re-encoding

* Remove struct experiment

* Cleanup Option

* Remove extra type defs from CodecStruct usage

* Expand Storage function with map (and type returns)

* Description around BaseCodec

* Cleanup linting, add Metadata test

* Move to api-codec

* Extract uniq types

* Uniq updates

* Unwrap, ungeneric
This commit is contained in:
Jaco Greeff
2018-09-24 13:51:20 +02:00
committed by GitHub
parent baaf394ccc
commit d9b05cf9f2
30 changed files with 3604 additions and 38 deletions
+18
View File
@@ -27,6 +27,20 @@ const callAt: CreateItemOptions = {
type: 'Bytes'
};
const getMetadata: CreateItemOptions = {
description: 'Returns the runtime metadata',
params: [],
type: 'MetaData'
};
const getMetadataAt: CreateItemOptions = {
description: 'Returns the runtime metadata',
params: [
param('block', 'Hash')
],
type: 'MetaData'
};
const getStorage: CreateItemOptions = {
description: 'Retrieves the storage for a key',
params: [
@@ -110,6 +124,10 @@ export default (name: Interface$Sections): Section<Interfaces, PrivateMethods, P
createMethod('call')(call),
callAt:
createMethod('callAt')(callAt),
getMetadata:
createMethod('getMetadata')(getMetadata),
getMetadataAt:
createMethod('getMetadataAt')(getMetadataAt),
getStorage:
createMethod('getStorage')(getStorage),
getStorageAt: