-
Notifications
You must be signed in to change notification settings - Fork 312
[SC] Returning structs will be pretty in receipts #4094
base: master
Are you sure you want to change the base?
[SC] Returning structs will be pretty in receipts #4094
Conversation
/// <summary> | ||
/// Get a string representation of a smart contract execution's return value. | ||
/// </summary> | ||
public static string GetSerializedReturnValue(object returnValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely doesn't belong in the CoinViewRule. We should return the result object, and leave it up to the presentation layer (in this case, the API controller) to decide how to display structs.
Also, we will probably want to reuse this for deserializing local calls to methods where the return type is a struct.
Nice idea 💯 . Would be good if we can make it reusable and apply it in other places where struct deserialization would be useful! |
I will do that, will componentise it soon as I get a chance |
return null; | ||
|
||
// All primitives will come from "a real place". Return the standard string representation. | ||
if (!String.IsNullOrEmpty(returnValue.GetType().Namespace)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User lowercase string
for consistency
Looks like this problem exists for byte arrays too, see #4099. |
No description provided.