Support sign raw in the Policy Engine #220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for
signRaw
action in the policy engine. It also refactors some of the existing plain types to use Zod schemas.Finally, it adds a top-level test recipe in the makefile to test a very single project. This is useful when you have cross project changes, and you want to make sure everything is working as expected.
Zod records with custom types
In Zod, when you define a record with primitives like
z.record(z.string(), z.string())
, the inferred type is indeedRecord<string, string>
, which aligns with expectations. However, if you define a record with az.custom
, such asz.record(z.custom<`0x${string}`>(), z.string())
, instead of gettingRecord<`0x${string}`, string>
, you actually end up withRecord<`0x${string}`, string | undefined>
.You can test it with the snippet below: