Skip to content

Feat: add union type to nnc field - #153

Merged
avivash merged 120 commits into
mainfrom
avivash/nnc-union-type
Mar 1, 2024
Merged

Feat: add union type to nnc field#153
avivash merged 120 commits into
mainfrom
avivash/nnc-union-type

Conversation

@avivash

@avivash avivash commented Feb 29, 2024

Copy link
Copy Markdown
Member

Description

Updating the nnc schema field to support objects of IPLD bytes. This is needed so we can send a nonce to Homestar to enable replays

Note: I haven't tested this yet, but it looks like zod supports union types in this format 🤷🏼

Link to sister PR

everywhere-computer/every-cli#6

Type of change

  • Refactor (non-breaking change that updates existing functionality)

Comment thread packages/homestar/src/schemas.js Outdated
rsc: z.string().url(),
nnc: z.string(),
nnc: z.union([
z.string(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be empty string, not any string according to homestar schema

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hugomrdias thanks 👍🏼 is z.string().length(0) the correct way to do that with zod? That's what I'm assuming based on the docs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@avivash
avivash removed the request for review from bgins March 1, 2024 18:29
@avivash
avivash force-pushed the avivash/nnc-union-type branch from cf90bfb to d4388f5 Compare March 1, 2024 18:40
@avivash

avivash commented Mar 1, 2024

Copy link
Copy Markdown
Member Author

i borked the signing. i'll clean this up shortly

@avivash
avivash force-pushed the avivash/nnc-union-type branch 2 times, most recently from 839e1d8 to 2ee7932 Compare March 1, 2024 19:05
@avivash
avivash force-pushed the avivash/nnc-union-type branch from 2ee7932 to b4e5fb1 Compare March 1, 2024 19:08
@avivash
avivash merged commit 6e881a6 into main Mar 1, 2024
@avivash
avivash deleted the avivash/nnc-union-type branch March 1, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants