mockthereum
mockthereum copied to clipboard
Id as body param
Viem.sh adds a new param called id
into body, but mock does not catch it.
https://github.com/httptoolkit/mockthereum/blob/7305bf991705b54421e66c3e4de94adbd8c3a02e/src/jsonrpc.ts#L12
Is there a way to extend this rules?
Hmm, I'm not sure what you mean - the matcher here should match requests that contain id
- it's a flexible JSON match, meaning the request must include the fields specified, but can include extra fields too.
I think the issue is that the body here doesn't include params: []
, which is supposed to be required. That might be a bug in Viem.sh, as every example I've seen (e.g. every method example listed on https://ethereum.org/en/developers/docs/apis/json-rpc/) does include this.
Do you know if there's any formal documentation that defines whether that's required?