Allow args as bytes for SC interactions - #673
Merged
Merged
Conversation
MiroMargineanu
previously approved these changes
Oct 22, 2025
andreibancioiu
previously approved these changes
Oct 22, 2025
There was a problem hiding this comment.
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.
popenta
dismissed stale reviews from andreibancioiu and MiroMargineanu
via
October 22, 2025 14:28
b6cd73b
MiroMargineanu
previously approved these changes
Oct 22, 2025
MiroMargineanu
previously approved these changes
Oct 22, 2025
andreibancioiu
previously approved these changes
Oct 22, 2025
popenta
dismissed stale reviews from andreibancioiu and MiroMargineanu
via
October 22, 2025 14:35
191fa74
MiroMargineanu
approved these changes
Oct 22, 2025
andreibancioiu
approved these changes
Oct 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
hexrepresentations and passed to the function.