Skip to content

Conversation

@shivam-bitgo
Copy link
Contributor

Ticket: COIN-5586

This pull request enforces stricter type safety for custom Aptos transactions by requiring the ABI (Application Binary Interface) to be explicitly provided and validated for every custom entry function call. It updates the interface, transaction logic, and tests to ensure that all custom transactions include a correct ABI, and adds validation logic to catch and reject invalid ABIs early in the transaction building process.

Custom transaction ABI enforcement and validation:

  • The abi field in CustomTransactionParams is now required (was optional) and must match the exact function signature of the target entry function, improving type safety and error reporting (modules/sdk-coin-apt/src/lib/iface.ts, modules/sdk-coin-apt/src/lib/transaction/customTransaction.ts).
  • Added a new validateAbi method to CustomTransaction to ensure the ABI structure is correct and provide clear error messages if it is not, causing transaction building to fail early when an invalid ABI is provided (modules/sdk-coin-apt/src/lib/transaction/customTransaction.ts).

Test suite updates for ABI requirement:

  • All unit tests for custom transaction building now explicitly provide the required ABI, including various valid and invalid cases, and new ABIs for custom token mint/burn functions. Tests now expect transaction building to fail if the ABI is missing or invalid (modules/sdk-coin-apt/test/unit/transactionBuilder/customTransactionBuilder.ts).

Behavioral changes and error handling:

  • Transaction builder will now throw errors for missing or malformed ABI, and tests verify that invalid ABIs are rejected, improving reliability and developer feedback (modules/sdk-coin-apt/test/unit/transactionBuilder/customTransactionBuilder.ts).

These changes ensure that all custom Aptos transactions are built with strict type validation, reducing runtime errors and improving developer experience.

@shivam-bitgo shivam-bitgo self-assigned this Sep 10, 2025
@shivam-bitgo shivam-bitgo force-pushed the COIN-5586-make-abi-mandatory-customtx branch from 64a3593 to 77a50c6 Compare September 10, 2025 10:38
@shivam-bitgo shivam-bitgo marked this pull request as ready for review September 10, 2025 11:36
@shivam-bitgo shivam-bitgo requested a review from a team as a code owner September 10, 2025 11:36
sachushaji
sachushaji previously approved these changes Sep 10, 2025
Copy link
Contributor

@baltiyal baltiyal left a comment

Choose a reason for hiding this comment

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

looks good to me

@kamleshmugdiya
Copy link
Contributor

ci is failing.
try to rebase.
axios vulnerability was fixed here #6971

@shivam-bitgo shivam-bitgo force-pushed the COIN-5586-make-abi-mandatory-customtx branch from a13b980 to fc3e879 Compare September 12, 2025 07:54
@shivam-bitgo
Copy link
Contributor Author

rebased with master for failing vulnerability CI check

@shivam-bitgo shivam-bitgo merged commit 4358f90 into master Sep 12, 2025
12 checks passed
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.

7 participants