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

[3.2] Fix non-working cleos set code and set abi commands #1897

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

linh2931
Copy link
Member

Cleos set code and set abi have not worked since release/3.2. The root cause is the common code set_code_callback for set contract and set code assumes contract-dir argument which is only applicable to set contract; and the common code set_code_callback for set abi and set code assumes contract-dir argument too.

This PR fixes the problem.

The fix has been tested manually. CI tests will be added to release/5.0 to minimize changes to 3.2.

Resolves #1868.

wasmPath = (cpath / wasmPath).generic_string();
// contractPath (set by contract-dir argument) is only applicable
// to "set contract" command
if(is_set_contract) {
Copy link
Member

Choose a reason for hiding this comment

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

you might be able to use !contractPath.empty() instead of a new variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. My solution emphasizes the intention of contractPath only applicable to set contract. Your solution is simpler and covers emptiness check for any conditions. Changed to use yours.

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