Commit Graph

7 Commits

Author SHA1 Message Date
Bruce Riley 5afd9eab2d Code review rework 2023-10-26 12:59:24 -04:00
Jeff Schroeder e613486b92 ethereum: QueryDemo updates
* Use custom errors in place of require() to match the error handling
style overall of QueryResponse.
2023-10-26 12:59:24 -04:00
Jeff Schroeder 1eb481b2c9 ethereum: QueryDemo updates
* Gas bad
* Natspec updates
* Some address(0) checks in the constructor
2023-10-26 12:59:24 -04:00
Jeff Schroeder f3b44e322b ethereum: move custom errors out in QueryResponse
If you don't do this, in the tests you have to do:

    vm.expectRevert(bytes4(keccak256("UnsupportedQueryType()")));

Whereas with this change, you can simply import the contract and do:

    vm.expectRevert(UnsupportedQueryType.selector);
2023-10-26 12:59:24 -04:00
Jeff Schroeder 15e1dcd3dd ethereum: update the QueryResponse contract
By moving the structs out of the abstract contract, you can use them
directly in any contract that imports QueryResponse.sol *without*
requiring that contract to inherit from the QueryResponse contract. This
seems to work much better with forge's coverage tooling.
2023-10-26 12:59:24 -04:00
Jeff Schroeder c40323828b ethereum: limit deps in the QueryDemo contract
- Context is generally a worthless import
- Ownable is totally unused and a worthless import
2023-10-26 12:59:24 -04:00
Bruce Riley faea3bab8d CCQ: EVM Library and Demo Contract 2023-10-26 12:59:24 -04:00