LIT-Protocol / js-serverless-function-test

12 stars 5 forks source link

Update HelloWorld and Tx Signing test to use the latest Lit SDK #8

Closed johnnynanjiang closed 1 year ago

johnnynanjiang commented 1 year ago

Problem

I got the following error when running yarn run sign

lit-protocol-js-serverless-function-test/node_modules/@lit-protocol/uint8arrays/src/lib/uint8arrays.js:15
        let charCode = str.charCodeAt(i);
                           ^

TypeError: str.charCodeAt is not a function
    at utf8Encode (/Users/nanjiang/Documents/dev/projects/Startup/J-Labs/projects/MPC/code/lit-protocol-js-serverless-function-test/node_modules/@lit-protocol/uint8arrays/src/lib/uint8arrays.js:15:28)
    at uint8arrayFromString (/Users/nanjiang/Documents/dev/projects/Startup/J-Labs/projects/MPC/code/lit-protocol-js-serverless-function-test/node_modules/@lit-protocol/uint8arrays/src/lib/uint8arrays.js:104:20)
    at LitNodeClientNodeJs.getLitActionRequestBody (/Users/nanjiang/Documents/dev/projects/Startup/J-Labs/projects/MPC/code/lit-protocol-js-serverless-function-test/node_modules/@lit-protocol/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.js:96:76)
    at LitNodeClientNodeJs.executeJs (/Users/nanjiang/Documents/dev/projects/Startup/J-Labs/projects/MPC/code/lit-protocol-js-serverless-function-test/node_modules/@lit-protocol/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.js:1088:38)
    at go (file:///Users/nanjiang/Documents/dev/projects/Startup/J-Labs/projects/MPC/code/lit-protocol-js-serverless-function-test/js-sdkTests/signTxn.js:34:39)
glitch003 commented 1 year ago

let's make this a larger PR to replace the old JS SDK with the new one, in the entire project. This could just be replacing the import at the top of all the files to use the new SDK. @joshLong145 can you build on this to accomplish that?

johnnynanjiang commented 1 year ago

Hi @joshLong145 I've merged your branch into this PR.

This PR fixes 2 tests so far

yarn run hello yarn run sign