Use primitives-json encode & decode (#41)
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
import type { FormatOutputType, InterfaceOutputType } from '@polkadot/api-jsonrpc/types';
|
||||
import type { FormatterFunction } from './types';
|
||||
|
||||
const headerFromJson = require('@polkadot/primitives-json/header/fromJson');
|
||||
const headerDecode = require('@polkadot/primitives-json/header/decode');
|
||||
|
||||
const formatNoop = require('./noop');
|
||||
const echo = require('./echo');
|
||||
const util = require('./util');
|
||||
|
||||
const formatters: { [FormatOutputType]: FormatterFunction } = {
|
||||
'Header': headerFromJson,
|
||||
'OutData': formatNoop,
|
||||
'StorageData': formatNoop
|
||||
'Header': headerDecode,
|
||||
'OutData': echo,
|
||||
'StorageData': echo
|
||||
};
|
||||
|
||||
module.exports = function formatOutput (output: InterfaceOutputType, value: any): any {
|
||||
|
||||
Reference in New Issue
Block a user