Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(iota): return String from PTB::execute() #5045

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Thoralf-M
Copy link
Member

Description of change

Return a String from PTB::execute so one can use it for tests

Links to any relevant issues

Fixes #5032

Type of change

  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

Modified test and running ptb commands like cargo run client ptb --help to verify that they still print the same as before and nothing duplicated

@Thoralf-M Thoralf-M requested a review from a team as a code owner January 27, 2025 23:20
Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Jan 27, 2025 11:20pm
apps-ui-kit ⬜️ Ignored (Inspect) Jan 27, 2025 11:20pm
rebased-explorer ⬜️ Ignored (Inspect) Jan 27, 2025 11:20pm
wallet-dashboard ⬜️ Ignored (Inspect) Jan 27, 2025 11:20pm

@iota-ci iota-ci added dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group. labels Jan 27, 2025
}
transaction_response.to_string()
};
println!("{result_string}");
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be useful to have a function that creates the string without printing it, more flexible

Copy link
Member Author

@Thoralf-M Thoralf-M Jan 28, 2025

Choose a reason for hiding this comment

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

I tried this, but then I don't see a way to render the output in special ways like the help output does currently with some words for example fat and with underline

Copy link
Member

Choose a reason for hiding this comment

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

Are you saying we are losing this information when converted to a string?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, unless we return StyledStr, but that seems to be more annoying to work with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor PTB::execute to return a String instead of printing
3 participants