-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #402 from LIT-Protocol/feature/lit-2674-js-sdk-mak…
…e-getlatestblockhash-async BREAKING CHANGE: make getLatestBlockhash async
- Loading branch information
Showing
19 changed files
with
70 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import path from 'path'; | ||
import { success, fail, testThis } from '../../tools/scripts/utils.mjs'; | ||
import LITCONFIG from '../../lit.config.json' assert { type: 'json' }; | ||
import { LitNodeClient } from '@lit-protocol/lit-node-client'; | ||
|
||
const LIT_NETWORK = 'cayenne'; | ||
|
||
export async function main() { | ||
// ==================== Test Logic ==================== | ||
const client = new LitNodeClient({ | ||
litNetwork: globalThis.LitCI.network, | ||
debug: globalThis.LitCI.debug, | ||
checkNodeAttestation: globalThis.LitCI.sevAttestation, | ||
}); | ||
await client.connect(); | ||
|
||
const latestBlockhash = await litNodeClient.getLatestBlockhash(); | ||
|
||
// ==================== Post-Validation ==================== | ||
if (!latestBlockhash) { | ||
return fail('latest blockhash not found'); | ||
} | ||
|
||
if (!latestBlockhash.startsWith('0x')) { | ||
return fail('latest blockhash not in hex format'); | ||
} | ||
|
||
// ==================== Success ==================== | ||
return success(`Latest blockhash found: ${latestBlockhash}`); | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,5 @@ | |
}, | ||
"tags": [ | ||
"universal" | ||
], | ||
"main": "./dist/src/index.js", | ||
"typings": "./dist/src/index.d.ts" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,5 @@ | |
}, | ||
"tags": [ | ||
"universal" | ||
], | ||
"main": "./dist/src/index.js", | ||
"typings": "./dist/src/index.d.ts" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -24,7 +24,5 @@ | |
}, | ||
"tags": [ | ||
"universal" | ||
], | ||
"main": "./dist/src/index.js", | ||
"typings": "./dist/src/index.d.ts" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -24,7 +24,5 @@ | |
}, | ||
"tags": [ | ||
"universal" | ||
], | ||
"main": "./dist/src/index.js", | ||
"typings": "./dist/src/index.d.ts" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -24,7 +24,5 @@ | |
}, | ||
"tags": [ | ||
"universal" | ||
], | ||
"main": "./dist/src/index.js", | ||
"typings": "./dist/src/index.d.ts" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -31,7 +31,5 @@ | |
}, | ||
"tags": [ | ||
"universal" | ||
], | ||
"main": "./dist/src/index.js", | ||
"typings": "./dist/src/index.d.ts" | ||
] | ||
} |