- 24 Aug, 2022 1 commit
-
-
Alexandru Vasile authored
Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io>
-
- 29 Jun, 2022 1 commit
-
-
Alexandru Vasile authored
* subscription: Allow errors in subscription callbacks Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * subscription: Remove the need to own the error Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * error: Build `ErrorObject` from `CallError` for improved ergonomics Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update examples for the new subscription API Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Add alias for subscription result Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * macros: Render server subscription method with `ResultSubscription` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Port `proc_macro` example to new API Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Rename `ResultSubscription` to `ReturnTypeSubscription` to avoid confusion Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Port all tests to new subscription API Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update documentation Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Port benches Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Replace tabs with spaces & add documentation Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Add dummy error for subscriptions Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Implement `From` for `SubscriptionError` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Return `SubscriptionError` when parsing params Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Rename `SubscriptionError` to `SubscriptionEmptyError` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Change `accept` signature Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Port tests to new `accept` api Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Implement `pipe_from_try_stream` and `pipe_from_stream` for `PendingSubscription` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Modify examples to ilustrate new API Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix docs tests Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Rename previously `SubscriptionResult` -> `InnerSubscriptionResult` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Rename `ReturnTypeSubscription` -> `SubscriptionResult` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Remove documentation line Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Implement `PipeFromStreamResult` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Add comment for empty error Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update proc-macros/src/lib.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Update proc-macros/src/lib.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Update proc-macros/src/lib.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Change `ReturnTypeSubscription` -> `SubscriptionResult` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Add `ResultConsumed` for `PipeFromStreamResult` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update examples to use `PipeFromStreamResult` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Replace ConsumedResult with Options Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Log warning when subscription callback fails Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Change ubuntu test names Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * server: Make `pipe` methods of `SubscriptionSink` private Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * server: Remove `pipe_from_stream` method of `SubscriptionSink` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * server: Update PipeFromStreamResult documentation Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Adjust tests to `SubscriptionSink::pipe_from_stream` private interface Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Add `accept-reject` API on `SubscriptionSink` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Make `pipe_from_try_stream` public Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Maybe accept the subscription Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Revert "server: Remove `pipe_from_stream` method of `SubscriptionSink`" This reverts commit d3c3ce9c . * Make `unsubscribe` channel optional on accepting the connection Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Pass `SubscriptionSink` to subscription callbacks Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Implement subscription sink state Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Submit `InvalidParams` if sink was never accepted Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Handle rejected sinks Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Remove `PendingSubscription` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix doc tests Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * macro: Make subscription sink mutable Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix tests and examples Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * macro: Return `sink.reject()` result Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * tests: Add test for `SubscriptionSinkState` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Test internal subscription sink state Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix `send_error` to not always return `false` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Fix benches Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Remove `PipeFromStreamResult` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Use valid Json-RPC return code for test errors Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Remove `SubscriptionSinkState`" * Remodel state machine using `Option`s for `SubscriptionSink`s Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * tests: Double accept / reject API for `SubscriptionSink` Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Implement `SubscriptionAcceptRejectError` for error propagation Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Remove `maybe_accept` wrapper Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update comments and documentation Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Update core/src/server/rpc_module.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Update core/src/server/rpc_module.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * rpc_server: Add type alias for unsubscription calls Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * rpc_server: Improve comment regarding dropped error Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * style: Single line return errors Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> * Make comment more verbose Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
James Wilson <james@jsdw.me>
-
- 13 Jun, 2022 1 commit
-
-
Niklas Adolfsson authored
* fix(servers): more descriptive errors calls fail Closing #775 * fix tests * rename constants * address grumbles
-
- 04 May, 2022 1 commit
-
-
Igor Aleksanov authored
-
- 20 Apr, 2022 1 commit
-
-
Niklas Adolfsson authored
* fix(rpc module): fail subscription with bad params * draft; show my point * fix tests * fix build * add tests for proc macros too * add tests for bad params in proc macros * fix nits * commit all files * add ugly fix for proc macro code * add more user friendly API * make SubscriptionSink::close take mut self * fix grumbles * show james some code * Update core/src/server/rpc_module.rs Co-authored-by:
James Wilson <james@jsdw.me> * remove needless clone * fix build * client fix docs + error type * simplify code: merge connect reset and unsubscribe close reason * remove unknown close reason * refactor: remove Error::SubscriptionClosed * add some nice APIs to ErrorObjectOwned * unify api * address grumbles * remove redundant methods for close and reject * proc macro: compile err when subscription -> Result * rpc module: fix test subscription test * Update core/src/server/rpc_module.rs Co-authored-by:
James Wilson <james@jsdw.me> * Update core/src/server/rpc_module.rs Co-authored-by:
James Wilson <james@jsdw.me> * Update core/src/server/rpc_module.rs Co-authored-by:
James Wilson <james@jsdw.me> * Update core/src/server/rpc_module.rs Co-authored-by:
James Wilson <james@jsdw.me> * Update core/src/server/rpc_module.rs Co-authored-by:
James Wilson <james@jsdw.me> * Update proc-macros/src/lib.rs Co-authored-by:
James Wilson <james@jsdw.me> * address grumbles * remove faulty comment * Update core/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update core/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update core/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update core/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update core/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * fix: don't send `RPC Call failed: error`. * remove debug assert Co-authored-by:
James Wilson <james@jsdw.me> Co-authored-by:
David <dvdplm@gmail.com>
-
- 30 Mar, 2022 1 commit
-
-
Niklas Adolfsson authored
* refactor: get rid off `Error::Request` variant * fix nit * to_owned -> to_call_error
-
- 22 Feb, 2022 1 commit
-
-
Niklas Adolfsson authored
* fix(rpc module): unsubscribe ethereum pubsub spec * update docs * fix clippy * fix tests
-
- 17 Dec, 2021 1 commit
-
-
Maciej Hirsz authored
* Nuke V2 * fmt * Formatting and imports * Updated benches * Fix doc comment link * Brace imports in ws-server * Reworking imports * std first * fmt * std on top * Update to match changed line numbers * Rename jsonrpsee_utils -> jsonrpsee_core * Migrating things types -> core * RpcError -> ErrorResponse * Merge types::client into core::client * Continued move types -> core * Removing features to make checks pass * Move rpc_module tests to tests crate * Fixed doc comment links * Add futures-util dependency for client * Remove dead code Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * fmt * Feature gate the Client trait * Move `Client` traits to `client` module Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 15 Dec, 2021 1 commit
-
-
Niklas Adolfsson authored
* refactor `SubscriptionClosed` I noticed that we "trying" to sending "close messages" on subscriptions that already has been terminated by the client which is unnecessary. Moreover, this introduces `fn is_closed` to check whether a given channel is closed without having to send an actual message on the channel. * cargo fmt * Update types/src/error.rs Co-authored-by:
David <dvdplm@gmail.com> * fix nits * more grumbles * make rust stable happy * SubscriptionClosed: add deny unknown fields Co-authored-by:
David <dvdplm@gmail.com>
-
- 17 Nov, 2021 1 commit
-
-
David authored
Closes https://github.com/paritytech/jsonrpsee/issues/448 This PR adds an implementation for `SubscriptionClient` to the `HttpClient` struct, which makes it possible for http clients to use macro-generated RPC servers. If an http client tries to set up a subscription it will fail with a `HttpNotImplemented` error.
-
- 11 Oct, 2021 2 commits
-
-
Niklas Adolfsson authored
Closing #485
-
Maciej Hirsz authored
* Squash post merge * RAII claims and some comments * Adding resources to Methods * Use arrays for claiming all resources at once * Register resources on ws-server * Return MethodResourcesBuilder from register_method * Return MethodResourcesBuilder from register_async_method * fmt and comments * Add `verify_and_insert` to get rid of `or_insert` in order to get mut ref to value * Resources initialization * No need for ResourceBuilder * Comment all the things * Handle errors on ws-server `start` method * Passing ResourceGuard to method execution * Start ws-server in background, simplify all the tests! * Claiming resources on runtime * Do checked math on resource claiming * Clearer error path for resources at limit * Resource limiting tests WIP * Unbox async futures * fmt * Cleaner proc macro * Fix lifetime issues with ResourceGuard with internal Arc * Remove unnecessary lifetime generic * Working tests * Use turbofish in tests * fmt * Fixed (?) benches * Apply suggestions from code review Co-authored-by:
David <dvdplm@gmail.com> * Tweak more grumbles * Adding a test for resource limiting with proc macros (WIP) * Reworking attribute macros for resource limiting (#507) * Squashed macros WIP * bae-less macros! * Make things simpler and more readable * Some comments and DRY aliases parsing * Naming things is hard * Respan is no longer needed * Simpler Arguments * Remove stale code * Apply suggestions from code review Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * syn-up all the things, handle resources on methods Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Resource limiting on the http server * Test two resources at once * Test the HTTP server for resource limiting * Apply suggestions from code review Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Comment tweaks * More explicit error type for `AttributeMeta::retain` * Remove generic from ResourceTable; derive Default on ws Builder * Make the macros shorter Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 14 Sep, 2021 1 commit
-
-
David authored
* Add a test illustrating how to use the `call` convenience method * Extend test + review feedback * log * log * log * log * log * log * log * log * log * log * log * log * log * log * log * Add Methods::test_subscription Log more when params parsing fails * Add call_with test helper (ty @niklas!) + cleanup * Remove todo (part of https://github.com/paritytech/jsonrpsee/issues/457 ) * fmt * Let `test_subscription` be called from other crates * Manually fix indentation * fmt * SSself-review grumbles * CallError::InvalidParams carries an anyhow::Error * fmt * Tweak docs * Update utils/src/server/rpc_module.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * review grumble * Fix todos * fmt * Fixup error messages * Include source in the error message for `CallError` * fmt * Update proc-macros/src/render_server.rs Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> * Mention needing jsonrpsee crate in scope * Resolve todo * Impl ToRpcParams for 0-sized array * optimized logging Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com>
-
- 25 Aug, 2021 1 commit
-
-
David authored
* Add license headers where missing and update year * Update examples/http.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 18 Aug, 2021 1 commit
-
-
Niklas Adolfsson authored
* rewrite me * require proc macro API to return result * send unknown message when error is not CallError * show example that auto cast StdError doesn't work * register_*_method Into<Error> * clippy * replace generic errors with anyhow::Error * fix nits * example that anyhow::Error in register_method works * CallError: add missing From impl * [types]: add helper methods for Error types The rationale is to make it possible for users to either use anyhow::Error or use the helper methods. * fmt * Revert "register_*_method Into<Error>" This reverts commit 33b4fa28730b72647ba150659d3c0ab1937e524a. * add better comment * fix nit
-
- 16 Aug, 2021 1 commit
-
-
David authored
* Sniff the first byte to glean if the incoming request is a single or batch request This works around the serde limitations around `untagged` enums and `RawValue`. * fmt * For http server, check first byte before allocating space for the body Also, rework the way we return errors: prefer JSON-RPC errors according to spec (application/json) wherever sensible. * Review feedback * Don't assume there is a first byte to read * ty clipyp * Review concerns * Cleanup
-
- 01 Jul, 2021 1 commit
-
-
Maciej Hirsz authored
* Set allowed Host header values * Error if allowed hosts list is empty * Grammar Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com>
-
- 29 Jun, 2021 1 commit
-
-
Niklas Adolfsson authored
* feat: customizable error via RpcError trait This commit introduces a new trait for defining user customizable error codes and messages * revert trait stuff * use RawValue * fix docs * rexport to_json_raw_value
-
- 24 Jun, 2021 1 commit
-
-
Igor Aleksanov authored
* Add a way to stop HTTP server * Add a way to stop WS server * Apply suggestions from code review Co-authored-by:
David <dvdplm@gmail.com> * Ensure the concrete type of error in stop test * Resolve merge artifacts * Add public re-exports of stop handle Co-authored-by:
David <dvdplm@gmail.com>
-
- 18 Jun, 2021 2 commits
-
-
Maciej Hirsz authored
* Initial implementation * Comments * Send a 403 on denied origin * Noodling around with `set_allowed_origins` * Error on empty list * Soketto 0.6 * fmt * Add `Builder::allow_all_origins`, clarify doc comments * Rename Cors -> AllowedOrigins, nits, no panic
-
Maciej Hirsz authored
* Make sync methods into Arc pointers * impl Clone for RpcModule and Methods * No need to wrap Methods in Arc anymore * Simplify generics * register_alias * fmt * grammar Co-authored-by:
James Wilson <james@jsdw.me> * Use a separate Arc counter for tracking max_connections Co-authored-by:
James Wilson <james@jsdw.me>
-
- 04 Jun, 2021 1 commit
-
-
Niklas Adolfsson authored
* [rpc module]: server-side close subscription Add functionality that closes the subscription after the sink has been dropped. * [integration tests]: add timeout on futures * remove global subscriber mutex * fix nit * [client types]: fix #349 Subscription::next() propogate error when parsing the response fails * [client types]: fix #349 Subscription::next() propogate error when parsing the response fails * unify subscription and notification * rename again * send notif response when subscription is dropped * stray debug stuff * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Revert "[client types]: fix #349" This reverts commit c4fefade719ebd8c964a62d0eb16f89db3346ccd. * Revert "[integration tests]: add timeout on futures" This reverts commit 21dfb99649aaaa8c847a693b4510e0202498fa2c. * show that actual edge-case * fix nit * Update types/src/traits.rs * fix bad merge * ugly; but works * complete solution * get rid of Option * Update tests/tests/integration_tests.rs * Update utils/src/server/rpc_module.rs * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * grumbles: fix faulty early return * remove weird abstraction KeepAlive * fix nits * revert test timeouts * address grumbles * fix build Co-authored-by:
David <dvdplm@gmail.com>
-
- 28 May, 2021 1 commit
-
-
Niklas Adolfsson authored
* [ws server]: draft SubscriptionSinkWithParams * rexport types * PoC design2 * improve example * Update ws-server/src/server.rs Co-authored-by:
David <dvdplm@gmail.com> * Subscription example (#324) * Add a test for calling methods with multiple params of multiple types (#308) * Add a test for calling methods with multiple params of multiple types * cargo fmt Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * [ws client] RegisterNotification support (#303) * Rename NotifResponse to SubscriptionResponse to make room for new impl * Add support for on_notification Subscription<T> types * Fix handling of NotificationHandler in manager * cleanup * Implement NotificationHandler to replace Subscription<T> and clean up plumbing * More cleanup * impl Drop for NotificationHandler * Address pr feedback #1 * ws client register_notification pr feedback 2 * Fix doc * fix typo * Add tests, get NH working * More cleanup of String/&str * fix doc * Drop notification handler on send_back_sink error * ws client notification auto unsubscribe when channel full test * Change order of type params to register_method (#312) * Change order of type params to register_method * Cleanup and fmt * Update ws-server/src/tests.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * CI: optimize caching (#317) * Bump actions/checkout from 2 to 2.3.4 (#315) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.3.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v2.3.4 ) Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions-rs/cargo from 1 to 1.0.3 (#314) Bumps [actions-rs/cargo](https://github.com/actions-rs/cargo) from 1 to 1.0.3. - [Release notes](https://github.com/actions-rs/cargo/releases) - [Changelog](https://github.com/actions-rs/cargo/blob/master/CHANGELOG.md) - [Commits](https://github.com/actions-rs/cargo/compare/v1...v1.0.3 ) Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions-rs/toolchain from 1 to 1.0.7 (#313) Bumps [actions-rs/toolchain](https://github.com/actions-rs/toolchain) from 1 to 1.0.7. - [Release notes](https://github.com/actions-rs/toolchain/releases) - [Changelog](https://github.com/actions-rs/toolchain/blob/master/CHANGELOG.md) - [Commits](https://github.com/actions-rs/toolchain/compare/v1...v1.0.7 ) Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [ws server]: add logs (#319) * WIP - hangs * fix example * cleanup * Add certificate_store() to WsClientBuilder (#321) * Add custom_certificate to WsClientBuilder * Use system certs instead of specified file * Cache client_config * Move client_config logic to fn build * Default use_system_certificates to true * Move out connector * Add CertificateStore type * cargo fmt * cargo clippy * Resolve comment: Rename variable * Resolved comments Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
Billy Lindeman <billylindeman@gmail.com> Co-authored-by:
Denis Pisarev <denis.pisarev@parity.io> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by:
Albin Hedman <albin9604@gmail.com> * grumbles: impl maciej proposal * fix test build * add test for subscription with param * cargo fmt * Update examples/ws_subscription.rs Co-authored-by:
David <dvdplm@gmail.com> * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * grumbles * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update utils/src/server/rpc_module.rs Co-authored-by:
David <dvdplm@gmail.com> * Update utils/src/server/rpc_module.rs Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> * fix more grumbles * [subscriptionSink]: introduce into_sinks * use replace * fix more nits * maciej design 2 * fix tests * remove log * [rpc context mod]: register_subscription with ctx * nits * nits again * move subscribers mutex * clippy * [ws subscribe]: avoid send message on unsubscribed * revert unintentional changes * Subscription with context example (#345) * Add weather example to show how to use subscriptions with context * Add note * Cleanup * Additional cleanup (#347) * Add weather example to show how to use subscriptions with context * Add note * Cleanup * fmt * Cleanup and docs * fmt * ignore error on subscription Co-authored-by:
David Palm <dvdplm@gmail.com> Co-authored-by:
Billy Lindeman <billylindeman@gmail.com> Co-authored-by:
Denis Pisarev <denis.pisarev@parity.io> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by:
Albin Hedman <albin9604@gmail.com> Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com>
-
- 24 May, 2021 1 commit
-
-
David authored
* Switch from anyhow::Result to std Result * fmt * Use thiserror `#[from]` * Remove sadness
-
- 19 May, 2021 1 commit
-
-
Niklas Adolfsson authored
* get started * add additional test * fix nits * cargo fmt * [types]: write some tests. * [http server]: send empty response on notifs * [http server]: fix tests * [rpc module]: send subscription response * Update types/src/v2/error.rs * fix nits * cargo fmt * Update types/src/v2/params.rs * remove needless clone * remove dead code * [types]: impl PartialEq for JsonErrorObject + test * use beef::Cow * Update http-server/src/tests.rs
-
- 12 May, 2021 1 commit
-
-
Billy Lindeman authored
* Rename NotifResponse to SubscriptionResponse to make room for new impl * Add support for on_notification Subscription<T> types * Fix handling of NotificationHandler in manager * cleanup * Implement NotificationHandler to replace Subscription<T> and clean up plumbing * More cleanup * impl Drop for NotificationHandler * Address pr feedback #1 * ws client register_notification pr feedback 2 * Fix doc * fix typo * Add tests, get NH working * More cleanup of String/&str * fix doc * Drop notification handler on send_back_sink error * ws client notification auto unsubscribe when channel full test
-
- 07 May, 2021 1 commit
-
-
David authored
* Batch requests over the websocket * Use same call signature for both http and ws server * Use CallError instead of InvalidParams Add a draft batch request test * Sort out formatting of batch responses Cleanup Use CallError * Add test for slow method calls * Update utils/src/server.rs Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Add benchmark for batched websocket requests * rename * Rename batch channels * Sort out the InvalidParams situation * Remove one level of InvalidParams Return app-level error when call fails * Update ws-server/src/server.rs Co-authored-by:
Andrew Plaza <aplaza@liquidthink.net> * Update ws-server/src/server.rs Co-authored-by:
Andrew Plaza <aplaza@liquidthink.net> Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by:
Andrew Plaza <aplaza@liquidthink.net>
-
- 04 May, 2021 1 commit
-
-
Niklas Adolfsson authored
* ret err if context/params fails * address grumbles: specific error_code context fail * address grumbles: make env_logger dev-dependency * address grumbles: add tests * chore(deps): remove unused deps * address grumbles: rename types and docs * address grumbles: more renaming. * fix build
-
- 28 Apr, 2021 1 commit
-
-
Niklas Adolfsson authored
-
- 20 Apr, 2021 1 commit
-
-
Niklas Adolfsson authored
* rewrite me * v2 * PoC works without batch request * remove `PartialEq` bounds * add naive benches types * misc * remove useless lifetime * [ws client]: move request ID generation to client * make tests compile again * [client transport]: kill leaky abstractions. * [http client transport]: minor changes in the API. * [ws client]: fix batch requests. * fix nits * [ws client]: generate two request IDs for subscrib * fix tests * remove unused types + less alloc for params. * fix nits * more tweaks. * remove unused code * fix more nits * remove unused legacy types * reorg types_v2 mod * port macros to new types * fix tests again; more jsonvalue * [proc macros]: bring back impl Into for params. * fix build * [proc macros]: make it work for external crates. * [types]: remove weird From<Option<T>> to impl. * cleanup again * [examples]: remove unused async-std dep * Update types/src/v2/mod.rs * [types]: remove unsed dep smallvec * rewrite me * [types]: error code impl ser/deser Manual implementation of serialize/deserialize to get rid of duplicated message string * [types v2]: re-org with explicit mods * fix faulty test * add missed files * [ws client]: req_manager reserve unsubscribe slot. * simplify test code * add tracking issue for TODO * remove unused deps
-
- 16 Apr, 2021 1 commit
-
-
Niklas Adolfsson authored
* [deps futures]: remove unused features I got annoyed that we bring in `futures-executor` as a dependency however `soketto` does this too, so doesn't help for the `WS` stuff. * cargo fmt
-
- 31 Mar, 2021 1 commit
-
-
Niklas Adolfsson authored
* feat(http client): batch requests * fix(http batch request): request in any order. * Update src/types/jsonrpc/id.rs * tests(batch out-of-order): make it less confusing. * fix nit: `cloned` -> `copied` * fix bad merge * [client]: batch request generic response * wait with impl * [ws client]: add template for batch requests * remove jsonvalue * naive impl * fix make it work, The implemenation is quite inefficient because the responses might be unordered. Currently, a "digest" of a BTreeSet is stored to sort the requestIDs and don't have to try all combinations of requestIDs in the response. * fix nits * error handling * fix nits * more nits * use error msg pattern * add batch requests to client trait Keep it simple by require `Vec<(Method, Params)>` could be improved. * address review comments: use swap_remove Replace read values with `Vec::swap_remove` instead inserting dummy value. The reason is that `Vec::remove` is O(n) * address review grumbles: batch trait bound Default * don't be clever * [http client]: faster lookup for batch request. * fix: distguish request_id and batch_id * thanks clippy * fix: clarify bad response with a separate error * fix tests * add issue link to todo * Update types/src/error.rs Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com>
-
- 12 Mar, 2021 2 commits
-
-
Niklas Adolfsson authored
* implement background error reporting * introduce new error variant * [ws client]: remove `Clone` Breaking change which removes the `Clone` on the `WsClient`. It's better that users explictly makes it clone if that's desired, for example by putting it in `Arc<Mutex>`. * fix build * Update ws-client/src/client.rs * remove unused arc * Update ws-client/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update ws-client/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update ws-client/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * fix rustdoc link Co-authored-by:
David <dvdplm@gmail.com>
-
Maciej Hirsz authored
* Squashed Module * RpcModule and RpcContextModule * Formatting * Add Default to RpcModule Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com> * Fixed grumbles, made module imports explicit * Export the modules Co-authored-by:
Niklas Adolfsson <niklasadolfsson1@gmail.com>
-
- 09 Mar, 2021 1 commit
-
-
Niklas Adolfsson authored
* [ws client]: register request ID for unsubscribe. Fixes #220 * refactor manager usage * restrict request ID to u8 * Update ws-client/src/tests.rs * rename `max_notifs_per_subscription_capacity` * Update tests/src/lib.rs * fix nits * address grumbles: vecdeq for free slots * resolve todo * [request manager]: add test for max limit. * Update ws-client/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * fix stack overflow * grumbles: MaxMemory -> MaxSlots * address grumbles: stray capacity on configs * Update types/src/client.rs Co-authored-by:
David <dvdplm@gmail.com> * grumbles: stray confusing docs * grumbles: doc nits * grumbles: remove nested if let Co-authored-by:
David <dvdplm@gmail.com>
-
- 26 Jan, 2021 1 commit
-
-
Aki authored
-
- 18 Jan, 2021 1 commit
-
-
Niklas Adolfsson authored
* update http example * ungeneric crate * update dependencies * [client]: add WebSocket client again. * [deps]: remove needless dev dependencies * nits: forgot to commit new files * [ws client]: `send_text` instead of `send_binary` This is temporary fix to work with the `server` which assumes that `WebSocket` resonses are `text` * chore: add a bunch of more logging * [ws]: port tests but some are failing. * chore: fmt * [server API]: expose `fn local_addr` as public API. * [tests]: make them less ugly by using `127.0.0.1:0` * fix: a bunch of compiler warnings. * [api]: uniform naming, `bind -> new` in transport. * [websocket server]: reply when deserial fails When the server receives an request with invalid JSON `-32700, Parse error shall be returned` * chore: fmt * [tests]: fix remaining tests * [websocket server]: support `binary` and `text` * [ws server]: fix bug in subscription response. `.await` was missing in RegisteredSubscription::send() and no responses were actually sent which this commit fixes. * [client API]: export `WsSubscription` * [examples]: use `localhost` instead of `127.0.0.1` Hostname is required when using `wss` and `127.0.0.1` is not valid hostname. * [examples]: add subscription example. * chore: fmt * [ws server]: fix bug register new subscription. Fixes newly introduced bug that causes `register_subscription` to have side-effects even if the subscription fails. * fmt * more uniform logs * [ws server]: simple subscription test. * [ws server]: subscription tests improved. * [tests]: extract test helpers to a separate crate (#125) * [ws server]: don't close connection when `deserialization` fails (#131) * [ws server]: don't close conn. when `deser` fails * Update src/ws/transport.rs * grumbles: prefer matching of if else. * chore: CI warn `intra_doc_link_resolution_failure` (#139) Since we have not updated the documentation properly it's annoying that the entire job fails. * chore: rustfmt.toml (#138) * chore: add `rustfmt.toml` for formatting * style: `cargo fmt --all` with new config * [server raw params]: fix debug implementation (#137) * [server]: simply raw params impl Use debug implementation of `common::Params` instead of doing something similar that doesn't work properly. * [raw params]: derive `Debug` impl. * [ws server]: parse subscription ID for unsubscription instead of hardcoding `JsonValue::Null` (#136) * [ws server]: fix broken unsubscribe. Try to parse the subscription ID as the first element of an Array or the `subscription` field of an Object/Map. If both of those fails then regard it as a error. * fmt * fix grumbles: remove space indentation * fix(ws server): sub/unsubscribe to same method should generate an error (#140) * fix(ws server): sub/unsubscribe to same method err Subscribe and unsubscribe to the same method should generate an error, which this commit fixed. This bug was introduced by myself in https://github.com/paritytech/jsonrpsee/commit/fc87889de2615dbb3d0cf2d91a306f016d48df2d * Update src/ws/server.rs Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com> * chore: add naive benches for request/response (#142) Co-authored-by:
Niklas <niklasadolfsson1@gmail.com> * fix(ws server): remove faulty debug_assert (#145) The code assumed that `subscription id` is still in `active_subscriptions` when the connection was dropped. The list of subscriptions (kept in raw server) are not notified when a client dropped its subscription/unsubscribed thus it's possible that the actual subscriptions are closed before the entire client was dropped. * ci(benches): cargo check on benches. (#146) * fix(http client): implement `clone` uniform API. (#147) * chore(deps): update `futures v0.3.7` (#148) * chore(deps): update remaining crates (#149) * chore(deps): update `futures v0.3.7` * chore(deps): bump the rest of deps * Improve HTTP client background thread (#150) * refactor: resultify API + some crate reorg (#144) * [ws client]: resultify API and fix subscribe. * The commit changes the API to return `Err` when it's possible and to not ignore underlying errors. * Fix that `fn subscribe` doesn't accept the subscription and unsubscription to be same which causes errors in the server. * nits: Err::SubscriptionMetod -> Err::Subscription * refactor(client): common error type * refactor(http client): resultify * refactor(common): rename common -> types.. This commit renames the `common module` to `types` and tries to distinguish the types that is directly related to the `JSON-RPC v2 specification` from others. Somethings are a little big sloppy named as naming is hard. Also, as bonus a removed a bunch of needless stuff in http server related to subscription. * Update src/ws/tests.rs * style: cargo fmt * fix(grumble): matches -> assert(matches) * fix(grumbles): `jsonrpc_v2` -> `jsonrpc` * fix(nit): remove unused code. * fix(benches): make it compile again. * style: cargo fmt * fix nits (#151) * fix(ws client): send binary (1 byte less payload) * docs(ws server): fix bad comment. * chore: add `editorconfig` (#152) * chore: make `debug log` less verbose. (#153) * chore: make `debug log` less verbose. The debug logging was just too verbose and this commit simplies it as follows: ``` DEBUG recv: {"jsonrpc":"2.0","method":"<METHOD>","params":<PARAMS>,"id":<ID>} DEBUG send: {"jsonrpc":"2.0","result":"<RESULT>","id":<ID>} ``` * style: cargo fmt * fix: missed logs * [jsonrpc types]: implement Display for Request/Response (#160) * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * use serde_json for verbosity * [http client]: refactor with "syncronous-like" design (#156) * experimental * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * ci(benches): sync and concurrent roundtrips Improve benchmarks to take concurrent requests into account. * fix(nits) * feat(http client): limit max request body size * test(http transport): request limit test * test(http client): add tests. * fix typo * fix(benches): make it compile again. * fix(ws example): revert unintentional change. * test(http client): subscription response on call. * fix(cleanup) * fix(benches): make it compile again. * Update src/client/http/transport.rs * fix(http client): `&str` -> `AsRef<str>` * docs(client types): better docs for Mismatch type. * style: `Default::default` -> `HttpConfig::default` * fix(http client): read body size from header. Expermential to read number of bytes from `HTTP Content Length` to pre-allocate the number of bytes and bail early if the length is bigger than the `max_request_body size` Need to be benched with bigger requests. * test(raw http): enable tests to works again. * style: cargo fmt * benches: address grumbles * feat(jsonrpc response/request): impl `Display` * refactor(logging): use display impl * fix(http client): nits. * Update benches/benches.rs * fix bad merge. * chore(deps): update dependencies. (#164) * feat(http server): configurable request body limit (#162) * feat(http server): configurable request body limit * refactor(crate reorg): to have shared http helpers. * Merge client and server errors. * Move `http_server_utils` to `utils/http` * Minor cleanup * fix nits * fix(hyper helper): u64 -> u32 * Update src/utils/http/hyper_helpers.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/utils/http/hyper_helpers.rs Co-authored-by:
David <dvdplm@gmail.com> * fix: grumbles * Update src/utils/http/hyper_helpers.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/http/server.rs Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com> * ci: remove nightly (#167) Use stabilized `broken_intra_doc_links` instead of `intra_doc_link_resolution_failure` * fix(websocket client): drop subscriptions that can't keep up with the internal buffer size (#166) * fix(ws client): drop subscriptions when full. This commit changes the behavior in the `WebSocket Client` where each subscription channel is used in a non-blocking matter until it is determined as full or disconnected. When that occurs the channel is simply dropped and when the user `poll` the subscription it will return all sent subscriptions before it was and terminate (return None) once it's polled one last time. Similarly as `Streams` works in Rust. It also adds configuration for the `WebSocket Client` to configure capacity for the different internal channels to avoid filling the buffers when it's not expected. * tests(ws client): simple subscription test. * fix: nits * Update src/client/ws/client.rs * refactor(tests): introduce integration_tests Make the repo structure more understable w.r.t testing. * chore(license): add missing license headers * Update src/client/ws/client.rs * Update src/client/ws/client.rs * style: remove unintended spaces. * tests: add concurrent deadlock test Ensure that if more than the requested channel buffer capacity is exceeded it should not deadlock. Such as spawning alot of concurrent requests, notifications or new subscriptions. * Update src/client/ws/client.rs * fix: review grumbles * fix nits: `remove needless closure` * fix: cargo fmt * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> * fix more nits Co-authored-by:
David <dvdplm@gmail.com> * fix(ws client): embed request id in `SubscriptionClosed` (#170) * fix(ws client): embed request id SubscriptClosed Fixes https://github.com/paritytech/jsonrpsee/issues/169 * Update src/client/ws/client.rs * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
David <dvdplm@gmail.com> * chore(deps): bump dependencies (#172) * [ws client]: add tests (#134) * [test utils]: add `internal_err` and consts [errors]: unify client/server errors [test utils]: fake WebSocket jsonrpc server [ws client]: export errors [ws client]: add some basic tests * fmt * remove log target * fix nits * [ws client]: add subscription test * revert unintendend changes. * fmt * [ws client]: fix panic in tests * cleanup * tests(ws client): test for invalid request ID. * fix nits * [ws client]: kill raw client (#171) * getting started * WIP WIP * cleanup * cleanup v2 * cleanup v3 * perf: use BufReader BufWriter * fix(request manager): resultify insert API The rationale behind this change is that the `insert_methods` takes ownership of the `send_back_oneshot` and if the operation fails it should be propagated the frontend. So returning the `Err(send_back_oneshot)` if it fails makes it possible. * fix nits * examples(ws): revert changes * Update tests/integration_tests.rs * nits: fix unwraps * Update src/client/ws/manager.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/client/ws/transport.rs Co-authored-by:
David <dvdplm@gmail.com> * Update src/client/ws/client.rs Co-authored-by:
David <dvdplm@gmail.com> * fix build * refactor: simplify `Error::InvalidRequestId` It was hard to use when the expected id is not known. * fix(ws client): error handling. * fix(grumble error type): better error message. * fix(grumble): docs `JSONRPC WebSocket transport` * fix(ws manager): fix grumbles. * Add better documentation * Rename methods. * Add `proof` to unreachable! * fix(ws manager): fix nit in docs. * fix(grumbles): ws client * fix more nits * fix compile warning: export websocket transports. * Update src/client/ws/manager.rs Co-authored-by:
David <dvdplm@gmail.com> * deps: tokio 1.0 and hyper 0.14 (#176) * deps: tokio 1.0 and hyper 0.14 * Update Cargo.toml * refactor: crate re-organization with separate crates (#177) * [ci]: feature `http` and `ws` removed. * refactor: re-org crate with smaller crates. * fmt * [ci]: remove default features Currently there are no features in the crates, so that check is not needed. * [http client]: remove unused dependency tokio * docs(http client): fix nits tokio 0.2 -> tokio 1.0 (#178) * docs(http client): tokio 0.2 -> tokio 1.0 * fix: better link * [ci]: github actions (#179) * docs(http client): tokio 0.2 -> tokio 1.0 * [ci]: remove travis * [ci]: add github actions. * [ci]: fix identation nits * [ci]: use cache for actions * [ci]: filter to clippy * [ci]: remove hacks * separate action for ci and benchmarks * [ci]: tweak to run on master branch. * examples/subscription -> examples/ws_subscription * force CI Co-authored-by:
David <dvdplm@gmail.com> Co-authored-by:
Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Co-authored-by:
Atkins <atkinschang@gmail.com>
-