Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Oct 5, 2024

Changes

How this PR will be tested

  • Open the dashboard and click X. Result: A modal should appear.
  • Call the /foo/bar API. Result: Returns 200 with "baz" in the response body.

Output

(Example: Screenshot/GIF for UI changes, cURL output for API changes)


PR-Codex overview

This PR focuses on enhancing the codebase by refining type definitions, improving error handling, and updating the structure of transaction-related functionalities. It also introduces new schemas and modifies existing ones to ensure better validation and usability.

Detailed summary

  • Changed client to export const client in test/e2e/utils/wallets.ts.
  • Updated transaction handling in test/e2e/tests/smoke.test.ts for better type safety.
  • Simplified chain parsing logic in test/e2e/utils/engine.ts.
  • Added abiArraySchema and AbiSchemaType in src/server/schemas/contract/index.ts.
  • Created sanitizeAbi function in src/server/utils/abi.ts for ABI validation.
  • Introduced formatError function in src/server/middleware/error.ts to standardize error formatting.
  • Changed abi type from any to Abi in src/utils/cache/getContractv5.ts.
  • Updated getContractV5 return type to Promise<ThirdwebContract>.
  • Modified writeToContract to use sanitizeAbi for ABI processing.
  • Enhanced error handling in test/e2e/tests/write.test.ts with assertions on response properties.
  • Added tests for writing to contracts with non-standard ABI in test/e2e/tests/write.test.ts.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@d4mr d4mr self-requested a review October 5, 2024 11:36
code,
});

export function formatError(error: unknown) {
Copy link
Contributor

@d4mr d4mr Oct 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move to /utils/errors?

@d4mr d4mr merged commit 921449d into main Oct 5, 2024
5 checks passed
@d4mr d4mr deleted the joaquim/accept_empty_ouput_abi branch October 5, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants