You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A missing sdk.Dec field doesn't appear as a blank string; It ends up becoming zero, which can be misleading. Here's an example response from when a trader opened and then closed the position on a test chain.
Notice that the margin ratio based on the index price, margin_ratio_index is zero because the test was run without a price feed.
How to Fix it - set gogoproto.nullable to true
According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset. - https://pkg.go.dev/github.com/gogo/protobuf/gogoproto
Tasks
Fix this
Test the fix
The text was updated successfully, but these errors were encountered:
The Problem
A missing
sdk.Dec
field doesn't appear as a blank string; It ends up becoming zero, which can be misleading. Here's an example response from when a trader opened and then closed the position on a test chain.Notice that the margin ratio based on the index price,
margin_ratio_index
is zero because the test was run without a price feed.How to Fix it - set gogoproto.nullable to true
Tasks
The text was updated successfully, but these errors were encountered: