diodechain / diode_server

Diode Server
https://diode.io
Other
39 stars 9 forks source link

Fix error when use node on mac #18

Closed sc0Vu closed 4 years ago

sc0Vu commented 4 years ago

It's a PR to fix some error when I use node on mac.

Since metamask had merged this PR https://github.com/MetaMask/metamask-extension/pull/9491, they added more validation on chainId.

Our chainId 15 won't be valid when client install the latest metamask (used to encoded to 0xf, but metamask required 0xf without leading 0), see: https://github.com/MetaMask/metamask-extension/blob/develop/ui/app/pages/settings/networks-tab/network-form/network-form.component.js#L275.

Fix:

dominicletz commented 4 years ago

Hi Peter, the inclusion looks good. For the metamask change, we shouldn't change the base library but instead make the formatting in the rpc.ex api code when returning the chainid. The last one, to throw an error on an empty method, when is that happening?

dominicletz commented 4 years ago

I've taken the things individually and commited:

sc0Vu commented 4 years ago

Cool, I can remove the change of Base library.

Because I got the 500 error when I sent some different rpc requests. Seems server didn't catch the error if id and method wasn't in the body.

sc0Vu commented 4 years ago

uh looks like you already pushed updates