Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify JSON-RPC request & response API #256

Closed
sekimondre opened this issue May 31, 2022 · 2 comments · Fixed by #261
Closed

Unify JSON-RPC request & response API #256

sekimondre opened this issue May 31, 2022 · 2 comments · Fixed by #261
Assignees
Labels
enhancement New feature or request

Comments

@sekimondre
Copy link

Right now, there are multiple types in the project that represent the same schema of a JSON-RPC request or response (WCRequest, JSONRPCRequest, ChatRequest, etc). They are basically duplicates that offer the same functionality, but increase the complexity of the codebase and the effort for maintaining them.

The goal is to provide a unified JSON-RPC request/response pattern API, that:

  • Is agnostic of any WalletConnect domain rules;
  • Is as compliant as possible with the JSON-RPC 2.0 specs;
  • Can replace the current JSON-RPC types scattered around the project.

This aims to reduce the complexity of the codebase and increase the scalability of the project.

The solution can be provided in its own swift package (import JSONRPC) and tested in isolation.

@sekimondre sekimondre added the enhancement New feature or request label May 31, 2022
@sekimondre sekimondre self-assigned this May 31, 2022
@sekimondre sekimondre moved this to Todo in Swift SDK May 31, 2022
@Mike117687
Copy link

merge-these-changes

Sent with GitHawk

@sekimondre sekimondre linked a pull request Jun 6, 2022 that will close this issue
sekimondre pushed a commit that referenced this issue Jun 8, 2022
* Add Chat target, split packages

* savepoint

* restructure chat's project folder

* fix schemas

* Add JSONRPC and Commons packages

* Moved AnyCodable to Commons

* Fixed test import

* Reintroduces either type

* Add request and response types

* Add simple response decode tests

* Add response ID parsing tests

* Fixed tests typo

* Improved response round trip coding test

* Error response decoding tests

* Invalid response decode tests

* Enabled code coverage for library

* Response decoding tests for structured result values

* Add flexible initializers with tests

* Add descriptions to errors thrown in response decoding

* Renamed response internalResult to outcome

* Basic RPC request decoding tests

* Tests for request empty cases and corner cases

* Add flexible inits for requests

* Add identifier generation inits

* Joined request notification extensions

* Renamed files

* Implemented default JSONRPC error cases

* Declared RPCRequestConvertible as public

* Remove rebase artifacts

* Added debug description to request param primitives error
@sekimondre
Copy link
Author

Merged

Repository owner moved this from Todo to Done in Swift SDK Jun 8, 2022
flypaper0 added a commit that referenced this issue Jun 9, 2022
* Cleanup Service + SequenceStore refactor (#241)

* Cleanup service

* Clean sessionToPairingTopic

* SequenceStore refactor

* Rename KeyValueStore -> CodableStore

* Deliver an invite (#254)

* Add Chat target, split packages

* savepoint

* Update networking interactor  to decode unencrypted messages

* pass on invite test

* restructure chat's project folder

* Add engine storages

* extract storage domain identifiers

* update logging

* fix schemas

* Update style

* Add publishers to Chat

* rename kv store to codable strore

* UI tests (#242)

* Pairing testcase

* Ping testcase

* ApproveSessionExistingPairing test case

* Unused extensions deleted

* Renamed to RegressionTests

* UITests step on CI

* CleanLaunch instead of deleting app

* Fix test on Real device

* Launch App fix

* Approve engine refactor (#260)

* Approve method moved ApproveEngine

* Reject and wcSessionSubscriptions for ApproveEngine

* Private methods moved in extension

* ApproveEngine errors handlers

* Try on reject

* ApproveEngine moved to callbacks

* Session Settle moved to approve Engine

* onProposeResponse subscription removed

* Reject by proposalId

* Settle moved to approve

* ApproveEngine moved to Controller folder

* typealias removed

* TODO for SettleEngine

* #256 JSON-RPC Package (& Commons) (#261)

* Add Chat target, split packages

* savepoint

* restructure chat's project folder

* fix schemas

* Add JSONRPC and Commons packages

* Moved AnyCodable to Commons

* Fixed test import

* Reintroduces either type

* Add request and response types

* Add simple response decode tests

* Add response ID parsing tests

* Fixed tests typo

* Improved response round trip coding test

* Error response decoding tests

* Invalid response decode tests

* Enabled code coverage for library

* Response decoding tests for structured result values

* Add flexible initializers with tests

* Add descriptions to errors thrown in response decoding

* Renamed response internalResult to outcome

* Basic RPC request decoding tests

* Tests for request empty cases and corner cases

* Add flexible inits for requests

* Add identifier generation inits

* Joined request notification extensions

* Renamed files

* Implemented default JSONRPC error cases

* Declared RPCRequestConvertible as public

* Remove rebase artifacts

* Added debug description to request param primitives error

Co-authored-by: Bartosz Rozwarski <bartus000@gmail.com>
Co-authored-by: André Vants <MisterVants@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants