-
Notifications
You must be signed in to change notification settings - Fork 707
test: add vm_error to snapshot #6587
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
base: develop
Are you sure you want to change the base?
Conversation
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.
I am ok with the serde approach, the message is clear, i am not concerned with the fact that it's included in the string itself. (note that there is a rust fmt error)
Hm I have mixed feelings. its annoying to custom write the entire debug struct, but I think the fields are pretty stable so once its written, it won't be so bad and I think its better to be explicit and then we don't actually modify the original struct. So I think I actually prefer the alternative approach if you don't mind XD but its rare that I have strong opinions and even when I do...they are loosely held so if you choose to ignore me, I will approve regardless. |
I gave a try to the Example with
Example with
The main issue is that with RON with have automatic field aligment (split per line, which should be good for better diffs), while with Maybe for now, better to stick with RON/serde integration (even if I also liked the debug solution, being nicest for the consenus message) |
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.
LGTM! the only remark I can make, is that we could decide to skip serialization of None values, but I am fine as-is!
Description
This PR does 2 things:
StacksTransactionReceipt::vm_error
to theExpectedTransactionOutput
ExpectedTransactionOutput::vm_error
for the snapshot appending a NON-CONSENSUS BREAKING info message. Basically we would like something like this:With the current solution, based on
serde
, we can only achieve this:Basically because they are json fields we are not allowed to add text outside the field.
Here I used a "static" approach so applying the trasformation directly to the
ExpectedTransactionOutput
definition, but we will have same result using the "dynamic" reduction approach done inside the test execution (because rely on serde/json).Alternative Approach
I also find a way to do what we want but requires to implement the
Debug
trait doing all the snaphoshot formatting "manually". Here a short example:This will produce the following snapshot:
So, for sure this is nice and give us the best flexibility (also for future formatting requirements), but we have to take into account for the whole struct formatting by ourselves.
What do you think?
Applicable issues
Additional info (benefits, drawbacks, caveats)
Checklist
docs/rpc/openapi.yaml
andrpc-endpoints.md
for v2 endpoints,event-dispatcher.md
for new events)clarity-benchmarking
repo