-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/lit 2407 js sdk add timestamp on each handshake to alert for when we #349
Closed
joshLong145
wants to merge
9
commits into
staging/3.1.3
from
feature/lit-2407-js-sdk-add-timestamp-on-each-handshake-to-alert-for-when-we
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2996279
support re connect after active node set change
aefd3f1
fmt
1055b8e
pr review
2546769
wip add timestamp on handshake with nodes
f7e1f1a
Merge remote-tracking branch 'origin/feature/lit-2406-add-support-for…
19c44fb
update latest block hash to refresh aftrer expiration
490c2f8
fix test
4fdc534
fmt
03e8f93
Merge branch 'staging/3.1.3' of github.com:LIT-Protocol/js-sdk into f…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
e2e-nodejs/group-latest-blockhash-update/test-block-has-update-after-exp.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import path from 'path'; | ||
import { success, fail, testThis } from '../../tools/scripts/utils.mjs'; | ||
import * as LitJsSdk from '@lit-protocol/lit-node-client'; | ||
import { LocalStorage } from 'node-localstorage'; | ||
|
||
export async function main() { | ||
const client = new LitNodeClient({ | ||
litNetwork: globalThis.LitCI.network, | ||
debug: globalThis.LitCI.debug, | ||
minNodeCount: globalThis.LitCI.minNodeCount, | ||
checkNodeAttestation: globalThis.LitCI.sevAttestation, | ||
storageProvider: { | ||
provider: new LocalStorage('./storage.test.db'), | ||
}, | ||
}); | ||
|
||
await client.connect(); | ||
let blockhash = await client.getLatestBlockhash(); | ||
await Promise.resolve( | ||
new Promise((resolve, reject) => { | ||
setTimeout(resolve, 40_000); | ||
}) | ||
); | ||
let updatedBlockhash = await client.getLatestBlockhash(); | ||
|
||
if (blockhash === updatedBlockhash) { | ||
return fail('block hash should be updated from handshake'); | ||
} | ||
console.log('block hashes: ', blockhash, updatedBlockhash); | ||
return success('block hash updates after expiration period'); | ||
} | ||
|
||
await testThis({ name: path.basename(import.meta.url), fn: main }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make
30_000
as constant