test(ethereum): fix broken validations in tests
Summary
Fix broken Ethereum connector validation behavior and refactor the affected negative tests to use Jest rejection matchers.
Changes
- reject unexpected top-level properties in
deployContract()requests - reject
web3.eth.getBlockcalls when required arguments are missing - refactor the three affected negative tests away from
try/catchassertions to Jest matchers
Verification
Validated in an isolated checkout by running:
geth-invoke-web3-method-v1.test.tsgeth-contract-deploy-and-invoke-using-json-object-v1.test.tsgeth-contract-deploy-and-invoke-using-keychain-v1.test.ts
Fixes #3475 Related to #3487
Verification summary:
- validated the targeted fix in an isolated checkout
- confirmed these issue-related integration tests pass end-to-end:
geth-invoke-web3-method-v1.test.tsgeth-contract-deploy-and-invoke-using-json-object-v1.test.tsgeth-contract-deploy-and-invoke-using-keychain-v1.test.ts
Note: while verifying, I found a separate repo-level Jest/TypeScript workspace-resolution issue in the temporary environment setup. I did not include those broader harness changes in this PR so the scope stays focused on #3475.
One scope note for reviewers: this PR fixes the three broken negative cases called out in #3487 and converts those assertions to Jest rejection matchers. It also adds the missing runtime validation that makes those expectations true again: unexpected top-level deployContract() fields now reject, and web3.eth.getBlock rejects when called without the required block argument.
Since #3475 is worded broadly as “all negative test case exception assertions” for the Ethereum connector, please let me know if you want this PR to remain scoped to the failing cases from #3487 or if we should expand it to sweep any remaining try/catch-style negative assertions before closing #3475.
Implemented the requested review fixes.
The negative deploy tests now validate one thing at a time by using valid gasConfig and keeping fake as the only unexpected top-level field. I also updated the connector so request-shape validation and missing getBlock args are treated as client errors and returned as 400 Bad Request, and refactored the affected negative tests to use Jest rejection matchers.
@malsomesh9 please fix the linter, so we can run the tests and try to merge
closed due to inactivity