refactor(test-utils): read the collateral straight from the captured public_data.json - #4143
Conversation
032b74b to
85558a8
Compare
public_data.json
…aping it `create-assets.sh` hex-encoded four collateral fields with hand-rolled `jq` arithmetic because the fixtures predate a type change: `Collateral` used to deserialize through a hex parser, so hex was the only shape that loaded. It and `QuoteBytes` are now plain serde types over `Vec<u8>`, so the captured shape reads directly, and `HexVec` already serializes to hex — no encoding to write either way. `collateral.json` is now derived from the committed capture by a test that writes it under `UPDATE_FIXTURES=1` and otherwise asserts it matches, the same pattern the verifier's borsh fixture uses. Its bytes are unchanged. `collateral()` returns the typed value, which lets the verifier test and the TEE authority test stop hand-decoding hex, and leaves the test-only hex parser with no users at all.
85558a8 to
bbaf519
Compare
|
@claude review |
gilcu3
left a comment
There was a problem hiding this comment.
LGTM, nice simplification!
Pull request overviewThis removes the hand-rolled JSON→ Changes:
Reviewed changesPer-file summary
I verified that the committed FindingsBlocking (must fix before merge):
Non-blocking (nits, follow-ups, suggestions):
|
|
@barakeinav1 could you review this when you’re back on Sunday (unless someone beats you to it)? Thanks! |
Follow-up on @gilcu3's code review comment: #4109 (comment).
Closes #4140