Skip to content

Allow args as bytes for SC interactions - #673

Merged
popenta merged 4 commits into
mainfrom
allow-args-as-bytes
Oct 23, 2025
Merged

Allow args as bytes for SC interactions#673
popenta merged 4 commits into
mainfrom
allow-args-as-bytes

Conversation

@popenta

@popenta popenta commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

If the Abi file is not provided to the factory/controller, the function's arguments can be passed as an array of bytes. The args are considered properly formatted, converted to their hex representations and passed to the function.

@popenta popenta self-assigned this Oct 22, 2025
MiroMargineanu
MiroMargineanu previously approved these changes Oct 22, 2025
andreibancioiu
andreibancioiu previously approved these changes Oct 22, 2025
@andreiblt
andreiblt requested a review from Copilot October 22, 2025 14:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for passing smart contract function arguments as raw bytes (Buffer or Uint8Array) when an ABI file is not provided. The factory now detects byte array arguments, converts them to their hex representation, and includes them in the transaction data.

Key changes:

  • Added buffer argument detection and conversion logic in the SmartContractTransactionsFactory
  • Added comprehensive test coverage for both TypedValue and byte array arguments

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/smartContracts/smartContractTransactionsFactory.ts Added areArgsBuffers() method to detect byte array arguments and extended argsToDataParts() to handle conversion of buffers to hex strings
src/smartContracts/smartContractTransactionsFactory.spec.ts Added test cases validating TypedValue arguments and byte array arguments (Buffer and Uint8Array)
package.json Version bump from 15.2.2 to 15.3.0

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/smartContracts/smartContractTransactionsFactory.ts
@popenta
popenta dismissed stale reviews from andreibancioiu and MiroMargineanu via b6cd73b October 22, 2025 14:28
MiroMargineanu
MiroMargineanu previously approved these changes Oct 22, 2025
MiroMargineanu
MiroMargineanu previously approved these changes Oct 22, 2025
andreibancioiu
andreibancioiu previously approved these changes Oct 22, 2025
@popenta
popenta dismissed stale reviews from andreibancioiu and MiroMargineanu via 191fa74 October 22, 2025 14:35
@popenta
popenta merged commit 341b734 into main Oct 23, 2025
5 checks passed
@popenta
popenta deleted the allow-args-as-bytes branch October 23, 2025 07:09
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.

4 participants