This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Repository navigation
cleos to display pushed actions' return values - #9375
Merged
Merged
Conversation
kimjh2005
reviewed
Aug 10, 2020
kimjh2005
reviewed
Aug 10, 2020
| const auto & iter = at.get_object().find("return_value_data"); | ||
| if( iter != at.get_object().end() ) { | ||
| return_value = fc::json::to_string(iter->value(), fc::time_point::maximum()); | ||
| } else { |
Contributor
There was a problem hiding this comment.
Wondering if you have to check "return_value_hex_data", too?
Contributor
Author
There was a problem hiding this comment.
No, "return_value_hex_data" will always be present(#9354)
Contributor
There was a problem hiding this comment.
What if you interact with an older version of nodeos? You need to support older nodeos versions.
Contributor
Author
There was a problem hiding this comment.
added a check for return_value_hex_data as well
kimjh2005
reviewed
Aug 11, 2020
kimjh2005
approved these changes
Aug 11, 2020
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Change Description
After abi_serializer was updated (#9354) it's time to utilize return values passed by
nodeosincleos.cleosnow is capable of displaying the actual return values or their hashes. The new output line starts with=>followed byreturn value:/return value (hex):and the return value.If the
return_value_datafield of returned json is presentcleoswill display it.If
return_value_datais missing andreturn_value_hex_datais present cleos will display value ofreturn_value_hex_data.If
return_value_datais missing andreturn_value_hex_datais empty (there is no return value)Example:
or
Change Type
Select ONE
Consensus Changes
API Changes
Documentation Additions
cleoswill have an extra line for actions that return values. The line will be prefixed with=>. Example actionsrstring()andruint()return values passed into them:It can work with structures/classes as well. For a struct like this:
and
rtmp()returning a default tmp object, output will look like this:When it wont be possible to decode the return value, output will look like this
If length on a return value string is more than 100 chars the string will be truncated to the first 100 chars and
...will be added at the end. It's similar to whatcleosdoes to action parameters output.