Skip to content

Commit

Permalink
rpc_methods return all methods available (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Jan 18, 2023
1 parent f18e3eb commit 213170c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/executor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { HexString } from '@polkadot/util/types'
import { WebSocket } from 'ws'
import {
compactAddLength,
compactToU8a,
Expand All @@ -9,7 +8,6 @@ import {
u8aConcatStrict,
u8aToHex,
} from '@polkadot/util'
global.WebSocket = WebSocket

import { Block } from './blockchain/block'
import { Registry } from '@polkadot/types-codec/types'
Expand Down
5 changes: 5 additions & 0 deletions src/rpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import substrate from './substrate'
const allHandlers: Handlers = {
...substrate,
...dev,
rpc_methods: async () =>
Promise.resolve({
version: 1,
methods: Object.keys(allHandlers),
}),
}

export const handler =
Expand Down
4 changes: 0 additions & 4 deletions src/rpc/substrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const handlers: Handlers = {
...chain,
...state,
...system,
rpc_methods: async () => ({
version: 1,
methods: Object.keys(handlers),
}),
}

export default handlers

0 comments on commit 213170c

Please sign in to comment.