Skip to content

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

Merged
linh2931 merged 2 commits intorelease/3.2from
fix_set_code_set_abi_3_2
Nov 14, 2023
Merged

[3.2] Fix non-working cleos set code and set abi commands#1897
linh2931 merged 2 commits intorelease/3.2from
fix_set_code_set_abi_3_2

Conversation

@linh2931
Copy link
Contributor

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
Contributor

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
Contributor 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