1. Oct 11, 2021
    • Niklas Adolfsson's avatar
      remove `ParamsSer::NoParams` (#501) · b3e4297b
      Niklas Adolfsson authored
      * fix(ParamsSer): serialize to empty array
      
      Serialize `ParamsSer::NoParams` to an empty array inorder to comply with the jsonrpc v2 spec.
      
      * fix tests
      
      * remove ParamsSer::NoParams
      
      * address grumbles: adjust rpc params macro
      b3e4297b
    • Niklas Adolfsson's avatar
      improve SubscriptionClosed error (#504) · 36bdb85e
      Niklas Adolfsson authored
      Closing #485
      36bdb85e
    • Maciej Hirsz's avatar
      Resource Limiting (#500) · 518a6155
      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: default avatarDavid <[email protected]>
      
      * 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: default avatarNiklas Adolfsson <[email protected]>
      
      * syn-up all the things, handle resources on methods
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * 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: default avatarDavid <[email protected]>
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * 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: default avatarDavid <[email protected]>
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      518a6155
  2. Oct 08, 2021
  3. Oct 05, 2021
  4. Oct 01, 2021
  5. Sep 30, 2021
  6. Sep 29, 2021
  7. Sep 24, 2021
  8. Sep 21, 2021
  9. Sep 17, 2021
  10. Sep 16, 2021
  11. Sep 15, 2021
    • David's avatar
      Rename and reorg types (#462) · 635142e3
      David authored
      * Renames
      
      * More renames
      
      * fmt
      
      * s/RpcParams/Params/
      
      * Add a type alias `SubscriptionResponse` to `Notification` which is parametrized to `SubscriptionPayload`
      Move `SubscriptionResponse` to the `response` module
      
      * Fix doc links
      
      * Cleanup and some docs
      
      * Review feedback
      
      * cleanup
      635142e3
    • Niklas Adolfsson's avatar
      [http server]: export acl types + remove cors_max_age (#466) · be96c56d
      Niklas Adolfsson authored
      * [http server]: export acl + kill cors_max_age
      
      * fix cors_max_age nit
      
      * fmt
      
      * remove max_cors_age
      be96c56d
  12. Sep 14, 2021
    • David's avatar
      Fix build warnings (#465) · c13f97ba
      David authored
      * Silence warning on cors_max_age
      
      * Revert change to `AccessControl`
      c13f97ba
    • David's avatar
      Propagate cause of `InvalidParams` (#463) · b16568b4
      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: default avatarNiklas Adolfsson <[email protected]>
      
      * 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: default avatarMaciej Hirsz <[email protected]>
      
      * Mention needing jsonrpsee crate in scope
      
      * Resolve todo
      
      * Impl ToRpcParams for 0-sized array
      
      * optimized logging
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      Co-authored-by: default avatarMaciej Hirsz <[email protected]>
      b16568b4
    • Maciej Hirsz's avatar
      Reject overflowing connection with status code 429 (#456) · bf2fff04
      Maciej Hirsz authored
      * Reject overflowing connection with status code 429
      
      * fmt
      
      * rename Handshake -> HandshakeMode for clarity; verbose test
      
      * Gracefully shutdown after rejecting to hopefully fix the errors on windows
      
      * HandshakeMode -> HandshakeResponse; tweak pending subscriptions on shutdown test
      bf2fff04
  13. Sep 13, 2021
  14. Sep 11, 2021
  15. Sep 09, 2021
  16. Sep 08, 2021
  17. Sep 01, 2021
    • Maciej Hirsz's avatar
      Tidy `StopHandle` (#425) · ffa504e2
      Maciej Hirsz authored
      
      
      * Experimental generic driver for methods
      
      * Move FutureDriver to its own module
      
      * "Infallible" sync methods + fmt
      
      * Drive all methods to completion before background_task closes
      
      * Testing a different stop handle
      
      * Added the waker for the monitors
      
      * Fix the test
      
      * Fix a possible deadlock
      
      * fmt
      
      * Explain strong_count check in StopHandle Drop impl
      
      * Clippy tweak
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      
      * Added comment on atomicbool ordering
      
      Co-authored-by: default avatarNiklas Adolfsson <[email protected]>
      ffa504e2
    • Niklas Adolfsson's avatar
      feat: alias attribute for proc macros (#442) · 3ad1cc21
      Niklas Adolfsson authored
      
      
      * feat: alias attribute for proc macros
      
      * implement David's suggested no more unsub field
      
      * keep aliases outside namespace
      
      * revert example
      
      * fix build
      
      * Update proc-macros/src/attributes.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * grumbles: alias -> aliases
      
      * grumbles v2: alias -> aliases
      
      Co-authored-by: default avatarDavid <[email protected]>
      3ad1cc21
    • Niklas Adolfsson's avatar
      Make it possible to treat empty JSON response as no params (#446) · bf211cb2
      Niklas Adolfsson authored
      
      
      * treat empty json as no params when optional
      
      * add test with nested array brackets
      
      * address grumbles: better tests
      
      * Update types/src/v2/params.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * introduce RpcParams::sequence_ignore_empty
      
      * address grumbles: ignore empty json in RpcParams
      
      * Update proc-macros/src/render_server.rs
      
      * address grumbles: remove trim in next_inner()
      
      * address grumbles: trim_start after params.next()
      
      * address more grumbles
      
      * [proc macros]: add test for empty array
      
      * make proc macro kind of work
      
      * add hack to make it work in proc macros
      
      * add hack to make it work in proc macros
      
      * [] ->
      
      * revert cerebral palsy
      
      * Update proc-macros/tests/ui/correct/basic.rs
      
      * Update proc-macros/tests/ui/correct/basic.rs
      
      * address grumbles
      
      * improve is_option
      
      * add test for core::option::Option
      
      Co-authored-by: default avatarDavid <[email protected]>
      bf211cb2
  18. Aug 31, 2021
  19. Aug 27, 2021
    • Niklas Adolfsson's avatar
      [proc macros]: support generic type params (#436) · 1045c785
      Niklas Adolfsson authored
      
      
      * PoC support generic type params
      
      * more annoying example
      
      * add trait bounds for generic params in proc macros
      
      * add compile-time test for complicated trait
      
      * smarter trait bounds in proc macros
      
      * add non-working example for now
      
      * revert nits
      
      * Update examples/proc_macro.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * add messy code but works
      
      * cleanup
      
      * add some simple compile check in tests
      
      * fix doc link
      
      * fix doc link last time
      
      * address grumbles
      
      * docs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/helpers.rs
      
      * Update proc-macros/src/visitor.rs
      
      * fix nit: | -> ||
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * add issues to introduced TODOs
      
      * generics support where clause on trait
      
      * Update proc-macros/src/helpers.rs
      
      Co-authored-by: default avatarDavid <[email protected]>
      
      * Update proc-macros/src/helpers.rs
      
      * address grumbles
      
      * add more docs
      
      Co-authored-by: default avatarDavid <[email protected]>
      1045c785
  20. Aug 25, 2021
  21. Aug 18, 2021
    • Niklas Adolfsson's avatar
      [proc macros] force proc macro api to return `Result` (#435) · 09abbaaa
      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
      09abbaaa