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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Goals
I want to check for accidental changes to RPC responses.
Suggestion
We could take a snapshot of each RPC response, and make sure it hasn't changed in our tests.
This stops us accidentally breaking RPCs with unrelated state, mempool, or chain tip changes.
Example
We already use
cargo insta
snapshot tests for database format changes.Here is some example code:
zebra/zebra-state/src/service/finalized_state/zebra_db/block/tests/snapshot.rs
Lines 202 to 204 in 41d240f
And the resulting snapshot:
zebra/zebra-state/src/service/finalized_state/zebra_db/block/tests/snapshots/tip@mainnet_2.snap
Lines 7 to 10 in 41d240f
And here is what a snapshot diff looks like:
https://github.com/ZcashFoundation/zebra/pull/3874/files#diff-aadf7c9252b61764f4ec695cab23b1c64dab2d768b0000676b71d5fe70838a53L16
Beta Was this translation helpful? Give feedback.
All reactions