Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

jsonrpsee integration #8783

Merged
merged 350 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
350 commits
Select commit Hold shift + click to select a range
b995567
Add tokio
dvdplm Aug 30, 2021
d8fa4f0
No need to map CallError to CallError
dvdplm Aug 30, 2021
d75493e
jsonrpsee proc macros (#9673)
niklasad1 Sep 3, 2021
11b26f1
Port over system_ rpc tests
dvdplm Sep 6, 2021
3cc43c2
Make it compile
dvdplm Sep 6, 2021
5f66746
Use prost 0.8
dvdplm Sep 6, 2021
6d6c1ff
Use prost 0.8
dvdplm Sep 6, 2021
ca95c8b
Make it compile
dvdplm Sep 6, 2021
dc56989
Merge branch 'dp-jsonrpsee-integration-2' into dp-rpc-testing
dvdplm Sep 6, 2021
67f4d6d
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 6, 2021
c45bff5
Ignore more failing tests
dvdplm Sep 6, 2021
dc8a2d0
Comment out WIP tests
dvdplm Sep 6, 2021
6ceeb07
fix nit in frame system api
niklasad1 Sep 6, 2021
174cbdd
Update lockfile
dvdplm Sep 6, 2021
b1ff6a7
No more juggling tokio versions
dvdplm Sep 6, 2021
1a74a64
No more wait_for_stop ?
dvdplm Sep 6, 2021
0eda45a
Remove browser-testing
dvdplm Sep 6, 2021
cb1f907
Arguments must be arrays
dvdplm Sep 6, 2021
d65a931
Use same argument names
dvdplm Sep 6, 2021
391d547
Resolve todo: no wait_for_stop for WS server
dvdplm Sep 6, 2021
f58eedb
fmt
dvdplm Sep 6, 2021
a88917f
log
dvdplm Sep 7, 2021
f96f0b5
One test passes
dvdplm Sep 8, 2021
d3e43d4
update jsonrpsee
niklasad1 Sep 8, 2021
ae96494
update jsonrpsee
niklasad1 Sep 13, 2021
32e206a
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 13, 2021
dbd10d9
cleanup rpc-servers crate
niklasad1 Sep 14, 2021
ce666f0
jsonrpsee: add host and origin filtering (#9787)
niklasad1 Sep 15, 2021
d4cfa37
remove unused files
niklasad1 Sep 16, 2021
210816a
resolve some todos
niklasad1 Sep 16, 2021
68ff17e
jsonrpsee more cleanup (#9803)
niklasad1 Sep 17, 2021
43af2b4
update jsonrpsee
niklasad1 Sep 17, 2021
959f406
downgrade zeroize
niklasad1 Sep 17, 2021
669e2ca
pin jsonrpsee rev
niklasad1 Sep 17, 2021
641bf8d
remove unwrap nit
niklasad1 Sep 17, 2021
8a6ba85
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 20, 2021
ea0ea2c
Merge branch 'dp-jsonrpsee-integration-2' into dp-rpc-testing
dvdplm Sep 20, 2021
6c17589
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 20, 2021
3c88421
Comment out more tests that aren't ported
dvdplm Sep 21, 2021
e15e945
Comment out more tests
dvdplm Sep 21, 2021
4997ede
Merge branch 'dp-jsonrpsee-integration-2' into dp-rpc-testing
dvdplm Sep 21, 2021
91c14b4
Fix tests after merge
dvdplm Sep 21, 2021
4f2b2cd
Subscription test
dvdplm Sep 21, 2021
46a637f
Invalid nonce test
dvdplm Sep 21, 2021
2278968
Pending exts
dvdplm Sep 21, 2021
4856d37
WIP removeExtrinsic test
dvdplm Sep 21, 2021
d4c6a4d
Test remove_extrinsic
dvdplm Sep 22, 2021
b7a78c9
Make state test: should_return_storage work
jsdw Sep 22, 2021
832ce62
Merge branch 'dp-rpc-testing' of github.com:paritytech/substrate into…
jsdw Sep 22, 2021
075e613
Uncomment/fix the other non-subscription related state tests
jsdw Sep 22, 2021
19f39f6
test: author_insertKey
dvdplm Sep 22, 2021
27a789d
test: author_rotateKeys
dvdplm Sep 22, 2021
f30a8be
Get rest of state tests passing
jsdw Sep 22, 2021
3116aa1
Merge branch 'dp-rpc-testing' of github.com:paritytech/substrate into…
jsdw Sep 22, 2021
947750c
asyncify a little more
jsdw Sep 22, 2021
3759645
Add todo to note #msg change
jsdw Sep 22, 2021
06cb6f5
Crashing test for has_session_keys
dvdplm Sep 23, 2021
966f0db
Fix error conversion to avoid stack overflows
dvdplm Sep 23, 2021
a34a590
test author_hasKey
dvdplm Sep 23, 2021
1abd83f
Add two missing tests
dvdplm Sep 24, 2021
1b14b0b
RPC tests for state, author and system (#9859)
dvdplm Sep 24, 2021
d91b15c
fix drop in state test
niklasad1 Sep 24, 2021
6f326d4
Merge remote-tracking branch 'origin/dp-jsonrpsee-integration-2' into…
niklasad1 Sep 24, 2021
6368752
update jsonrpsee
niklasad1 Sep 27, 2021
efb701a
fix ignored system test
niklasad1 Sep 27, 2021
8800f0c
fix chain tests
niklasad1 Sep 27, 2021
5b7e32d
remove some boiler plate
niklasad1 Sep 27, 2021
cbc4642
Port BEEFY RPC (#9883)
dvdplm Sep 28, 2021
464c6d8
trivial changes left over from merge
dvdplm Sep 30, 2021
15d15bb
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Sep 30, 2021
fa719a3
Remove unused code
dvdplm Oct 1, 2021
ab17c6d
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Oct 1, 2021
26926e6
Update jsonrpsee
dvdplm Oct 1, 2021
fd9e1ae
fix build
niklasad1 Oct 6, 2021
b983887
make tests compile again
niklasad1 Oct 7, 2021
f9bcb98
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Oct 8, 2021
66da48f
beefy update jsonrpsee
niklasad1 Oct 9, 2021
f67e23e
fix: respect rpc methods policy
niklasad1 Oct 9, 2021
570958e
update cargo.lock
niklasad1 Oct 9, 2021
795ff10
update jsonrpsee
niklasad1 Oct 11, 2021
1aefa99
update jsonrpsee
niklasad1 Oct 13, 2021
084e98c
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Oct 18, 2021
18536f4
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Oct 21, 2021
7a6ea8d
downgrade error logs
niklasad1 Nov 1, 2021
ea90fd1
update jsonrpsee
niklasad1 Nov 1, 2021
01622c6
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 3, 2021
7898fcc
Fix typo
dvdplm Nov 3, 2021
08caf2a
remove unused file
niklasad1 Nov 8, 2021
f7b9f80
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 8, 2021
1737599
Better name
dvdplm Nov 8, 2021
bc8df75
Port Babe RPC tests
dvdplm Nov 8, 2021
9ddb0e9
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Nov 8, 2021
6a7ed3f
Put docs back
dvdplm Nov 8, 2021
24cb823
Resolve todo
dvdplm Nov 8, 2021
c5abbae
Port tests for System RPCs
dvdplm Nov 8, 2021
e2fdd1a
Resolve todo
dvdplm Nov 8, 2021
7ad29c8
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 9, 2021
f6b0a1c
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 11, 2021
06c2d73
fix build
niklasad1 Nov 11, 2021
5c307dc
Updated jsonrpsee to current master
maciejhirsz Nov 11, 2021
4e1c295
fix: port finality grandpa rpc tests
niklasad1 Nov 11, 2021
48fdeaf
Merge remote-tracking branch 'origin/dp-jsonrpsee-integration-2' into…
niklasad1 Nov 11, 2021
97b7254
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 11, 2021
8fb4d4d
Move .into() outside of the match
dvdplm Nov 12, 2021
32e16e7
more review grumbles
dvdplm Nov 12, 2021
4894b27
jsonrpsee: add `rpc handlers` back (#10245)
niklasad1 Nov 12, 2021
99c7ca3
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 12, 2021
95d709b
fix grumble: remove needless alloc
niklasad1 Nov 12, 2021
c127c68
resolve TODO
niklasad1 Nov 12, 2021
415835f
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 15, 2021
2da1969
fmt
dvdplm Nov 15, 2021
721423c
Fix typo
dvdplm Nov 16, 2021
23a7dd1
grumble: Use constants based on BASE_ERROR
dvdplm Nov 16, 2021
76ef3bd
grumble: DRY whitelisted listening addresses
dvdplm Nov 16, 2021
6bf7584
cleanup
dvdplm Nov 16, 2021
7b254bd
grumbles: Making readers aware of the possibility of gaps
dvdplm Nov 16, 2021
3babd88
review grumbles
dvdplm Nov 16, 2021
2b4118f
grumbles
dvdplm Nov 16, 2021
75041ed
remove notes from niklasad1
niklasad1 Nov 16, 2021
49e587e
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 17, 2021
ef8d325
Update `jsonrpsee`
dvdplm Nov 17, 2021
8901195
fix: jsonrpsee features
niklasad1 Nov 17, 2021
2570371
jsonrpsee: fallback to random port in case the specified port failed …
niklasad1 Nov 18, 2021
9347959
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 18, 2021
fcb6fd7
Update jsonrpsee to 092081a0a2b8904c6ebd2cd99e16c7bc13ffc3ae
dvdplm Nov 18, 2021
6a04da2
lockfile
dvdplm Nov 18, 2021
5ae444b
update jsonrpsee
niklasad1 Nov 18, 2021
ccd9736
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Nov 19, 2021
bec87f6
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 19, 2021
5d2605d
fix warning
dvdplm Nov 19, 2021
4246269
Don't fetch jsonrpsee from crates
dvdplm Nov 19, 2021
538f03a
make tests compile again
niklasad1 Nov 19, 2021
27907c7
fix rpc tests
niklasad1 Nov 19, 2021
6b8e50d
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 19, 2021
930bb9e
remove unused deps
niklasad1 Nov 19, 2021
b22f74b
update tokio
niklasad1 Nov 19, 2021
03f7301
fix rpc tests again
niklasad1 Nov 19, 2021
ece49e3
fix: test runner
niklasad1 Nov 19, 2021
47ec471
cargo fmt
niklasad1 Nov 19, 2021
730f7c8
grumbles: fix subscription aliases
niklasad1 Nov 21, 2021
1c0a6b8
make clippy happy
niklasad1 Nov 21, 2021
f889cb5
update remaining subscriptions alias
niklasad1 Nov 22, 2021
5d4d22a
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 22, 2021
7ab1b7f
cleanup
dvdplm Nov 22, 2021
4727565
cleanup
dvdplm Nov 22, 2021
44a3e3d
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Nov 22, 2021
7034e6e
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 22, 2021
5acc878
fix chain subscription: less boiler plate (#10285)
niklasad1 Nov 22, 2021
d6f4170
cargo fmt
niklasad1 Nov 23, 2021
925059f
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 23, 2021
67a6dab
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 24, 2021
6c658df
Switch to jsonrpsee 0.5
dvdplm Nov 24, 2021
14dae6a
fix build
niklasad1 Nov 24, 2021
6e34af0
add missing features
niklasad1 Nov 24, 2021
1c11977
fix nit: remove needless Box::pin
niklasad1 Nov 29, 2021
a378fdd
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 30, 2021
0eadbe3
Integrate jsonrpsee metrics (#10395)
dvdplm Dec 1, 2021
beec025
fix build
niklasad1 Dec 1, 2021
3bd55fb
remove needless Arc::clone
niklasad1 Dec 1, 2021
ecc872c
Update to jsonrpsee 0.6
dvdplm Dec 1, 2021
57e3c80
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 1, 2021
eed6c6a
lolz
niklasad1 Dec 1, 2021
5d1148d
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
dvdplm Dec 2, 2021
9544b06
fix metrics
niklasad1 Dec 2, 2021
bd5ceae
Revert "lolz"
niklasad1 Dec 2, 2021
3e96b8e
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Dec 2, 2021
30d220d
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Dec 2, 2021
d8d2e46
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
dvdplm Dec 3, 2021
3b6ff68
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 6, 2021
e8801ce
fix: in-memory rpc support subscriptions
niklasad1 Dec 7, 2021
6b90e0f
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Dec 7, 2021
4655ba8
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 10, 2021
604335a
Merge remote-tracking branch 'origin' into dp-jsonrpsee-integration-2
niklasad1 Dec 14, 2021
ec79904
commit Cargo.lock
niklasad1 Dec 14, 2021
09f8852
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 23, 2021
36400aa
Update tests to 0.7
dvdplm Dec 23, 2021
08c8e3c
fix TODOs
niklasad1 Jan 3, 2022
f414cf6
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 3, 2022
5d59277
ws server: generate subscriptionIDs as Strings
niklasad1 Jan 4, 2022
9d7e6be
Increase timeout
dvdplm Jan 11, 2022
7a5a6b4
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 11, 2022
54c2dd9
Port over tests
dvdplm Jan 12, 2022
66c6c54
cleanup
dvdplm Jan 12, 2022
b5fecd6
Using error codes from the spec
dvdplm Jan 13, 2022
3966532
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 13, 2022
30b5624
fix clippy
niklasad1 Jan 13, 2022
26e622b
cargo fmt
niklasad1 Jan 13, 2022
f718474
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 14, 2022
fc311f4
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 17, 2022
f35044a
update jsonrpsee
niklasad1 Jan 23, 2022
f959e93
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 23, 2022
5a86875
fix nits
niklasad1 Jan 23, 2022
5ff0165
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 25, 2022
0a61c83
fix: rpc_query
niklasad1 Jan 25, 2022
5c5eb70
enable custom subid gen through spawn_tasks
niklasad1 Jan 25, 2022
b37b768
remove unsed deps
niklasad1 Jan 25, 2022
b58da3c
unify tokio deps
niklasad1 Jan 25, 2022
cc8d671
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 26, 2022
3b76732
Revert "enable custom subid gen through spawn_tasks"
niklasad1 Jan 26, 2022
7f2a252
fix bad merge of `test-utils`
niklasad1 Jan 26, 2022
5a5776a
fix more nits
niklasad1 Jan 27, 2022
538867c
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 28, 2022
f08a7c1
downgrade wasm-instrument to 0.1.0
niklasad1 Jan 28, 2022
cec775d
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Feb 3, 2022
2f337d0
[jsonrpsee]: enable custom RPC subscription ID generatation (#10731)
niklasad1 Feb 3, 2022
6e8450b
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Feb 7, 2022
4678fbb
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 10, 2022
2a2d4d7
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 11, 2022
c16a523
cargo fmt
niklasad1 Mar 14, 2022
50a4c6f
Merge remote-tracking branch 'origin/master' into HEAD
niklasad1 Mar 14, 2022
bb4a87a
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 18, 2022
8c3b057
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 22, 2022
5f50afb
fmt
dvdplm Mar 23, 2022
2d8b4ef
port RPC-API dev
niklasad1 Mar 23, 2022
9d777d0
Remove unused file
dvdplm Mar 23, 2022
0150fc4
fix nit: remove async trait
niklasad1 Mar 23, 2022
f9aa57d
fix doc links
niklasad1 Mar 23, 2022
43db19a
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Mar 24, 2022
07f668c
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Mar 24, 2022
ab681d0
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 3, 2022
c1e51c1
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 6, 2022
cf40d19
fix merge nit: remove jsonrpc deps
niklasad1 Apr 7, 2022
7037547
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 7, 2022
4bfeaaa
kill namespace on rpc apis
niklasad1 Apr 7, 2022
f209e07
companion for jsonrpsee v0.10 (#11158)
dvdplm Apr 7, 2022
ab11cb5
send error before subs are closed
niklasad1 Apr 7, 2022
a6ccd66
fix unsubscribe method names: chain
niklasad1 Apr 12, 2022
34897e0
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 19, 2022
5c1977d
fix tests
niklasad1 Apr 19, 2022
0ed8413
jsonrpc server: print binded local address
niklasad1 Apr 19, 2022
5b99226
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 19, 2022
3103f6f
grumbles: kill SubscriptionTaskExecutor
niklasad1 Apr 20, 2022
760ae95
Update client/sync-state-rpc/src/lib.rs
niklasad1 Apr 20, 2022
dea4c81
Update client/rpc/src/chain/chain_full.rs
niklasad1 Apr 20, 2022
0e4081a
Update client/rpc/src/chain/chain_full.rs
niklasad1 Apr 20, 2022
6614117
sync-state-rpc: kill anyhow
niklasad1 Apr 20, 2022
e7b34f8
no more anyhow
niklasad1 Apr 20, 2022
f502e03
remove todo
niklasad1 Apr 20, 2022
c9f6e59
jsonrpsee: fix bad params in subscriptions. (#11251)
niklasad1 Apr 20, 2022
5107c79
dont do weird stuff in drop impl
niklasad1 Apr 20, 2022
2ee97b8
jsonrpsee v0.11
niklasad1 Apr 21, 2022
b03a471
rpc servers: remove needless clone
niklasad1 Apr 22, 2022
c5492c6
Remove silly constants
dvdplm Apr 22, 2022
d2e2390
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 May 6, 2022
be14e01
chore: update jsonrpsee v0.12
niklasad1 May 6, 2022
60d5b1f
commit Cargo.lock
niklasad1 May 6, 2022
2788cc2
deps: downgrade git2
niklasad1 May 6, 2022
e156038
feat: CLI flag max subscriptions per connection
niklasad1 May 7, 2022
0955558
metrics: use old logging format
niklasad1 May 7, 2022
44581c6
fix: read WS address from substrate output (#11379)
niklasad1 May 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 197 additions & 30 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,14 @@ pub fn new_light_base(
telemetry: telemetry.as_mut(),
})?;

network_starter.start_network();
Ok((
task_manager,
rpc_handlers,
client,
network,
transaction_pool,
))
todo!();
// Ok((
// task_manager,
// rpc_handlers,
// client,
// network,
// transaction_pool,
// ))
}

/// Builds a new service for a light client.
Expand Down
1 change: 1 addition & 0 deletions client/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ serde_json = "1.0.41"
sp-transaction-pool = { version = "3.0.0", path = "../../primitives/transaction-pool" }
sp-rpc = { version = "3.0.0", path = "../../primitives/rpc" }
sp-tracing = { version = "3.0.0", path = "../../primitives/tracing" }
jsonrpsee-types = { git = "https://github.com/paritytech/jsonrpsee", branch = "master" }
11 changes: 9 additions & 2 deletions client/rpc-api/src/author/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

use crate::errors;
use jsonrpc_core as rpc;
use jsonrpsee_types::error::CallError;
use sp_runtime::transaction_validity::InvalidTransaction;

/// Author RPC Result type.
Expand All @@ -34,14 +35,14 @@ pub enum Error {
/// Client error.
#[display(fmt="Client error: {}", _0)]
#[from(ignore)]
Client(Box<dyn std::error::Error + Send>),
Client(Box<dyn std::error::Error + Send + Sync>),
/// Transaction pool error,
#[display(fmt="Transaction pool error: {}", _0)]
Pool(sp_transaction_pool::error::Error),
/// Verification error
#[display(fmt="Extrinsic verification error: {}", _0)]
#[from(ignore)]
Verification(Box<dyn std::error::Error + Send>),
Verification(Box<dyn std::error::Error + Send + Sync>),
/// Incorrect extrinsic format.
#[display(fmt="Invalid extrinsic format: {}", _0)]
BadFormat(codec::Error),
Expand Down Expand Up @@ -182,3 +183,9 @@ impl From<Error> for rpc::Error {
}
}
}

impl From<Error> for CallError {
fn from(e: Error) -> Self {
Self::Failed(Box::new(e))
}
}
2 changes: 1 addition & 1 deletion client/rpc-api/src/chain/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub type FutureResult<T> = Box<dyn rpc::futures::Future<Item = T, Error = Error>
pub enum Error {
/// Client error.
#[display(fmt="Client error: {}", _0)]
Client(Box<dyn std::error::Error + Send>),
Client(Box<dyn std::error::Error + Send + Sync>),
/// Other error type.
Other(String),
}
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-api/src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ pub trait ChainApi<Number, Hash, Header, SignedBlock> {
metadata: Option<Self::Metadata>,
id: SubscriptionId,
) -> RpcResult<bool>;
}
}
7 changes: 7 additions & 0 deletions client/rpc-api/src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//! RPC when accessed externally.

use jsonrpc_core as rpc;
use jsonrpsee_types::error as rpsee;

/// Signifies whether a potentially unsafe RPC should be denied.
#[derive(Clone, Copy, Debug)]
Expand Down Expand Up @@ -60,3 +61,9 @@ impl From<UnsafeRpcError> for rpc::Error {
rpc::Error::method_not_found()
}
}

impl From<UnsafeRpcError> for rpsee::CallError {
fn from(e: UnsafeRpcError) -> rpsee::CallError {
rpsee::CallError::Failed(Box::new(e))
}
}
2 changes: 1 addition & 1 deletion client/rpc-api/src/state/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub type FutureResult<T> = Box<dyn rpc::futures::Future<Item = T, Error = Error>
pub enum Error {
/// Client error.
#[display(fmt="Client error: {}", _0)]
Client(Box<dyn std::error::Error + Send>),
Client(Box<dyn std::error::Error + Send + Sync>),
/// Provided block range couldn't be resolved to a list of blocks.
#[display(fmt = "Cannot resolve a block range ['{:?}' ... '{:?}]. {}", from, to, details)]
InvalidBlockRange {
Expand Down
3 changes: 2 additions & 1 deletion client/rpc-api/src/system/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@

use crate::system::helpers::Health;
use jsonrpc_core as rpc;
use serde::Serialize;

/// System RPC Result type.
pub type Result<T> = std::result::Result<T, Error>;

/// System RPC errors.
#[derive(Debug, derive_more::Display, derive_more::From)]
#[derive(Debug, derive_more::Display, derive_more::From, Serialize)]
pub enum Error {
/// Provided block range couldn't be resolved to a list of blocks.
#[display(fmt = "Node is not fully functional: {}", _0)]
Expand Down
4 changes: 4 additions & 0 deletions client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
async-trait = "0.1"
anyhow = "1"
sc-rpc-api = { version = "0.9.0", path = "../rpc-api" }
sc-client-api = { version = "3.0.0", path = "../api" }
sp-api = { version = "3.0.0", path = "../../primitives/api" }
Expand Down Expand Up @@ -42,6 +44,8 @@ hash-db = { version = "0.15.2", default-features = false }
parking_lot = "0.11.1"
lazy_static = { version = "1.4.0", optional = true }
sp-tracing = { version = "3.0.0", path = "../../primitives/tracing" }
jsonrpsee-ws-server = { git = "https://github.com/paritytech/jsonrpsee", branch = "master" }
jsonrpsee-types = { git = "https://github.com/paritytech/jsonrpsee", branch = "master" }

[dev-dependencies]
assert_matches = "1.3.0"
Expand Down
Loading