Skip to content

Commit 7a5deec

Browse files
feat(rpc): Implement payment_queryInfo RPC call (ChainSafe#1826)
* chore: adding payment rpc module * chore: adding unit test to runtime call * chore: use defined extrinsic * chore: add Payment Query Info * chore: add unit test to runtime layer * chore: add unit tests * chore: resolve uint128 * chore: fix lint warns * chore: put condition back * chore: use pkg/scale uint128 * chore: fix unit tests * chore: remove debug from config.toml * fix: lint * chore: remove tests from wasmtime and life * chore: resolving conflicts * chore: remove life impl form payment query info * chore: simplify chain_test function * chore: ignore unused meth receiver
1 parent 2ef59a8 commit 7a5deec

File tree

25 files changed

+461
-45
lines changed

25 files changed

+461
-45
lines changed

chain/dev/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ enabled = true
3535
ws = true
3636
port = 8545
3737
host = "localhost"
38-
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"]
38+
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"]
3939
ws-port = 8546

chain/dev/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var (
8787
// DefaultRPCHTTPPort rpc port
8888
DefaultRPCHTTPPort = uint32(8545)
8989
// DefaultRPCModules rpc modules
90-
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"}
90+
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"}
9191
// DefaultRPCWSPort rpc websocket port
9292
DefaultRPCWSPort = uint32(8546)
9393
// DefaultRPCEnabled enables the RPC server

chain/gssmr/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ discovery-interval = 10
3535
enabled = false
3636
port = 8545
3737
host = "localhost"
38-
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"]
38+
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"]
3939
ws-port = 8546

chain/gssmr/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ var (
9292
// DefaultRPCHTTPPort rpc port
9393
DefaultRPCHTTPPort = uint32(8545)
9494
// DefaultRPCModules rpc modules
95-
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"}
95+
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"}
9696
// DefaultRPCWSPort rpc websocket port
9797
DefaultRPCWSPort = uint32(8546)
9898
)

chain/kusama/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enabled = false
3535
external = false
3636
port = 8545
3737
host = "localhost"
38-
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"]
38+
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"]
3939
ws-port = 8546
4040
ws = false
4141
ws-external = false

chain/kusama/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var (
8383
// DefaultRPCHTTPPort rpc port
8484
DefaultRPCHTTPPort = uint32(8545)
8585
// DefaultRPCModules rpc modules
86-
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"}
86+
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"}
8787
// DefaultRPCWSPort rpc websocket port
8888
DefaultRPCWSPort = uint32(8546)
8989
)

chain/polkadot/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ nomdns = false
3434
enabled = false
3535
port = 8545
3636
host = "localhost"
37-
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"]
37+
modules = ["system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"]
3838
ws-port = 8546

chain/polkadot/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ var (
8484
// DefaultRPCHTTPPort rpc port
8585
DefaultRPCHTTPPort = uint32(8545)
8686
// DefaultRPCModules rpc modules
87-
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate"}
87+
DefaultRPCModules = []string{"system", "author", "chain", "state", "rpc", "grandpa", "offchain", "childstate", "payment"}
8888
// DefaultRPCWSPort rpc websocket port
8989
DefaultRPCWSPort = uint32(8546)
9090
)

dot/rpc/http.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ func (h *HTTPServer) RegisterModules(mods []string) {
129129
srvc = modules.NewOffchainModule(h.serverConfig.NodeStorage)
130130
case "childstate":
131131
srvc = modules.NewChildStateModule(h.serverConfig.StorageAPI, h.serverConfig.BlockAPI)
132+
case "payment":
133+
srvc = modules.NewPaymentModule(h.serverConfig.BlockAPI)
132134
default:
133135
h.logger.Warn("Unrecognised module", "module", mod)
134136
continue

dot/rpc/modules/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type BlockAPI interface {
4545
SubChain(start, end common.Hash) ([]common.Hash, error)
4646
RegisterRuntimeUpdatedChannel(ch chan<- runtime.Version) (uint32, error)
4747
UnregisterRuntimeUpdatedChannel(id uint32) bool
48+
GetRuntime(hash *common.Hash) (runtime.Instance, error)
4849
}
4950

5051
// NetworkAPI interface for network state methods

0 commit comments

Comments
 (0)