Skip to content

Commit 86b806e

Browse files
author
Josh Long
committed
Merge branch 'feature/lit-2921-js-sdk-migrate-to-jest' of github.com:LIT-Protocol/js-sdk into feat/long-running-epoch-testing
2 parents 7405ba5 + de2ce15 commit 86b806e

File tree

96 files changed

+2330
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2330
-380
lines changed

.env.ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ NO_SETUP=false
1010
USE_SHIVA=true
1111
NETWORK_CONFIG=./networkContext.json
1212
TEST_TIMEOUT=45000
13+
LIT_RPC_URL=http://127.0.0.1:8545
1314

1415
#Shiva Client ENV Vars
1516
STOP_TESTNET=false

.github/workflows/intigration-test-long-running.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ jobs:
7676
run: docker stop shiva && docker rm shiva
7777
- name: Post Pull Shiva Image
7878
if: steps.shiva-pull.outputs.exit_code == 0
79-
run: docker rmi ghcr.io/lit-protocol/shiva
79+
run: docker rmi ghcr.io/lit-protocol/shiva

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ storage.test.db
7171

7272
local-tests/build
7373
# local-tests/setup/networkContext.json
74-
.env
74+
.env
75+
76+
packages/wrapped-keys-lit-actions/src/generated

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<h1>Lit Protocol Javascript/Typescript SDK V6.4.x</h1>
2+
<h1>Lit Protocol Javascript/Typescript SDK V6.5.x</h1>
33

44
<img src="https://i.ibb.co/p2xfzK1/Screenshot-2022-11-15-at-09-56-57.png">
55
<br/>
@@ -82,6 +82,7 @@ If you're a tech-savvy user and wish to utilize only specific submodules that ou
8282
| [@lit-protocol/types](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/types) | ![types](https://img.shields.io/badge/-universal-8A6496 'types') | <a target="_blank" href="https://www.npmjs.com/package/@lit-protocol/types"><img src="https://img.shields.io/npm/v/@lit-protocol/types"/></a> |
8383
| [@lit-protocol/uint8arrays](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/uint8arrays) | ![uint8arrays](https://img.shields.io/badge/-universal-8A6496 'uint8arrays') | <a target="_blank" href="https://www.npmjs.com/package/@lit-protocol/uint8arrays"><img src="https://img.shields.io/npm/v/@lit-protocol/uint8arrays"/></a> |
8484
| [@lit-protocol/wrapped-keys](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/wrapped-keys) | ![wrapped-keys](https://img.shields.io/badge/-universal-8A6496 'wrapped-keys') | <a target="_blank" href="https://www.npmjs.com/package/@lit-protocol/wrapped-keys"><img src="https://img.shields.io/npm/v/@lit-protocol/wrapped-keys"/></a> |
85+
| [@lit-protocol/wrapped-keys-lit-actions](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/wrapped-keys-lit-actions) | ![wrapped-keys-lit-actions](https://img.shields.io/badge/-universal-8A6496 'wrapped-keys-lit-actions') | <a target="_blank" href="https://www.npmjs.com/package/@lit-protocol/wrapped-keys-lit-actions"><img src="https://img.shields.io/npm/v/@lit-protocol/wrapped-keys-lit-actions"/></a> |
8586
| [@lit-protocol/auth-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/auth-browser) | ![auth-browser](https://img.shields.io/badge/-browser-E98869 'auth-browser') | <a target="_blank" href="https://www.npmjs.com/package/@lit-protocol/auth-browser"><img src="https://img.shields.io/npm/v/@lit-protocol/auth-browser"/></a> |
8687
| [@lit-protocol/misc-browser](https://github.com/LIT-Protocol/js-sdk/tree/master/packages/misc-browser) | ![misc-browser](https://img.shields.io/badge/-browser-E98869 'misc-browser') | <a target="_blank" href="https://www.npmjs.com/package/@lit-protocol/misc-browser"><img src="https://img.shields.io/npm/v/@lit-protocol/misc-browser"/></a> |
8788

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
33
"useNx": true,
44
"useWorkspaces": true,
5-
"version": "6.4.10"
5+
"version": "6.5.3"
66
}

nx.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
"build": {
1616
"dependsOn": ["^build"],
1717
"inputs": ["production", "^production"]
18+
},
19+
"@nx/esbuild:esbuild": {
20+
"cache": true,
21+
"dependsOn": ["^build"],
22+
"inputs": ["production", "^production"]
1823
}
1924
},
2025
"workspaceLayout": {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"@cosmjs/proto-signing": "0.30.1",
4444
"@cosmjs/stargate": "0.30.1",
4545
"@dotenvx/dotenvx": "^1.6.4",
46+
"@lit-protocol/accs-schemas": "^0.0.12",
4647
"@lit-protocol/contracts": "^0.0.63",
47-
"@lit-protocol/accs-schemas": "^0.0.11",
4848
"@metamask/eth-sig-util": "5.0.2",
4949
"@mysten/sui.js": "^0.37.1",
5050
"@simplewebauthn/browser": "^7.2.0",
@@ -57,7 +57,6 @@
5757
"@walletconnect/types": "2.9.2",
5858
"@walletconnect/utils": "2.9.2",
5959
"@walletconnect/web3wallet": "1.8.8",
60-
"@websaam/nx-esbuild": "^0.0.1",
6160
"ajv": "^8.12.0",
6261
"axios": "^0.27.2",
6362
"base64url": "^3.0.1",
@@ -86,6 +85,7 @@
8685
"uint8arrays": "^4.0.3"
8786
},
8887
"devDependencies": {
88+
"@nx/esbuild": "^17.3.0",
8989
"@nx/eslint-plugin": "17.3.0",
9090
"@nx/jest": "17.3.0",
9191
"@nx/js": "17.3.0",
@@ -109,7 +109,7 @@
109109
"cypress": "11.0.1",
110110
"cypress-metamask": "^1.0.5-development",
111111
"cypress-metamask-v2": "^1.7.2",
112-
"esbuild": "0.19.12",
112+
"esbuild": "^0.17.3",
113113
"esbuild-node-builtins": "^0.1.0",
114114
"esbuild-node-externals": "^1.13.0",
115115
"esbuild-plugin-tsc": "^0.4.0",

packages/access-control-conditions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"tags": [
2222
"universal"
2323
],
24-
"version": "6.4.10",
24+
"version": "6.5.3",
2525
"main": "./dist/src/index.js",
2626
"typings": "./dist/src/index.d.ts"
2727
}

packages/auth-browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"tags": [
3131
"browser"
3232
],
33-
"version": "6.4.10",
33+
"version": "6.5.3",
3434
"main": "./dist/src/index.js",
3535
"typings": "./dist/src/index.d.ts"
3636
}

packages/auth-browser/src/lib/chains/eth.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
log,
4040
numberToHex,
4141
throwError,
42+
validateSessionSig,
4243
} from '@lit-protocol/misc';
4344
import { getStorageItem } from '@lit-protocol/misc-browser';
4445

@@ -661,7 +662,13 @@ export const checkAndSignEVMAuthMessage = async ({
661662

662663
// -- 9. finally, if the authSig is expired, re-sign
663664
// if it's not expired, then we don't need to resign
664-
if (isSignedMessageExpired(authSig.signedMessage)) {
665+
const checkAuthSig = validateSessionSig(authSig);
666+
667+
if (isSignedMessageExpired(authSig.signedMessage) || !checkAuthSig.isValid) {
668+
if (!checkAuthSig.isValid) {
669+
log(`Invalid AuthSig: ${checkAuthSig.errors.join(', ')}`);
670+
}
671+
665672
log('9. authSig expired!, resigning..');
666673

667674
authSig = await _signAndGetAuth({

0 commit comments

Comments
 (0)