explodinglabs / jsonrpcserver

Process incoming JSON-RPC requests in Python
MIT License
186 stars 40 forks source link

"Result" monad's "Left" and "Right" types are reversed #226

Closed mikepii closed 2 years ago

mikepii commented 2 years ago

Result is defined as:

https://github.com/explodinglabs/jsonrpcserver/blob/f489ed886f68b893ec95c38297ea84c5df2c5adb/jsonrpcserver/result.py#L34

However, the runtime values are reversed:

https://github.com/explodinglabs/jsonrpcserver/blob/f489ed886f68b893ec95c38297ea84c5df2c5adb/jsonrpcserver/dispatcher.py#L105-L114

Therefore mypy complains if users type their methods with -> Result.

bcb commented 2 years ago

Are you able to send a PR for this?

bcb commented 2 years ago

Otherwise I can do it later today.

Thanks for reporting by the way.

mikepii commented 2 years ago

sure, I'll send a PR