fix: parse Tempo chain IDs strictly - #94
Conversation
|
Hi! is this meant to be an application change? it only looks like it changes tests |
|
Yes, this is intended to be an application change. The implementation file was accidentally omitted from the previous commit. I’ve now added the strict chainId validation to |
|
can you add tests / coverage for the application changes (func asInt64(value any) (int64, bool, error)) explicitly? |
|
I’ve added explicit table-driven tests for asInt64, covering int, int64, whole-number floats, valid strings, fractional floats, malformed strings, empty strings, unsupported types, and nil. I’ve also retained the ParseChargeRequest regression tests to verify the application-level behavior. |
|
thanks! |
|
@codex review there are some lint issues too @cryptoryda |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cea033391
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| } | ||
|
|
||
| tests := []struct { |
There was a problem hiding this comment.
Wrap the new table test in a test function
The new tests := ... declaration is at package scope rather than inside a function, so Go cannot parse this test file (expected declaration, found tests). Consequently, every go test invocation that includes pkg/tempo fails before compiling or running any tests; add the missing func TestAsInt64(t *testing.T) { ... } wrapper around the table and loop.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
updated lint issue
Validate Tempo chainId parsing strictly
Summary
methodDetails.chainIdvalueschainIdvalues instead of accepting partial parsesWhy
Charge requests should not silently coerce an invalid chain ID. This keeps challenge parsing deterministic and prevents accidental chain mismatches.
Tests