Fix lit-node-client-nodejs
test by adding issuedAt
to SIWE message
#772
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.
Description
This PR fixes the failing test in
packages/lit-node-client-nodejs/src/lib/helpers/validate-bls-session-sigs.spec.ts
. The test currently throws:because the
SiweMessage
created in the test hasexpirationTime
but noissuedAt
. According toblsSessionSigVerify
logic invalidate-bls-session-sig.ts
, bothissuedAt
andexpirationTime
must be present.By adding
issuedAt: new Date().toISOString()
to thenew SiweMessage({ ... })
, the test now passes without error, aligning with EIP-4361 which typically includesissuedAt
.Related Issue:
fix #771
Type of change
How Has This Been Tested?
npx nx run lit-node-client-nodejs:test
locally after addingissuedAt
.Test Suites: 13 passed, 13 total
Tests: 43 passed, 43 total
Snapshots: 0 total
Time: 4.758 s
Ran all test suites.
—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Nx read the output from the cache instead of running the command for 1 out of 1 tasks.
Checklist:
Note: If in the future we decide that
issuedAt
is not strictly required, we can revisitblsSessionSigVerify
. For now, EIP-4361 and Lit’s validation logic suggest thatissuedAt
is the correct approach.