Skip to content
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

Fix/pkp ethers #459

Merged
merged 13 commits into from
May 10, 2024
Merged

Conversation

Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented May 9, 2024

Description

Make pkp-ethers compatible with auth uni

doc: 9625d06

// v5
import { PKPEthersWallet } from '@lit-protocol/pkp-ethers';

const pkpEthersWallet = new PKPEthersWallet({
  controllerAuthMethods,
  controllerAuthSig,
  pkpPubKey,
  rpc,
  litNetwork: globalThis.LitCI.network,
});

// v6
import { PKPEthersWallet } from '@lit-protocol/pkp-ethers';

const pkpEthersWallet = new PKPEthersWallet({
  controllerSessionSigs,
  litNodeClient,
  pkpPubKey,
});

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Test command

NETWORK=cayenne yarn test:local --filter=PkpEthers 

Result:

- testUseEoaSessionSigsToExecuteJsSigning (Passed in 13534.18 ms)
- testUseEoaSessionSigsToPkpSign (Passed in 9857.76 ms)
- testUseEoaSessionSigsToExecuteJsSigningInParallel (Passed in 13560.68 ms)
- testUseEoaSessionSigsToExecuteJsClaimKeys (Passed in 8813.03 ms)
- testUseEoaSessionSigsToExecuteJsClaimMultipleKeys (Passed in 9859.54 ms)
- testUseEoaSessionSigsToExecuteJsJsonResponse (Passed in 8772.34 ms)
- testUseEoaSessionSigsToExecuteJsConsoleLog (Passed in 10568.71 ms)
- testUseEoaSessionSigsToEncryptDecryptString (Passed in 10481.46 ms)
- testUseEoaSessionSigsToEncryptDecryptFile (Passed in 25522.16 ms)
- testUseEoaSessionSigsToEncryptDecryptZip (Passed in 26119.20 ms)
- testUsePkpSessionSigsToExecuteJsSigning (Passed in 25544.25 ms)
- testUsePkpSessionSigsToPkpSign (Passed in 23905.80 ms)
- testUsePkpSessionSigsToExecuteJsSigningInParallel (Passed in 22851.32 ms)
- testUsePkpSessionSigsToExecuteJsClaimKeys (Passed in 23600.03 ms)
- testUsePkpSessionSigsToExecuteJsClaimMultipleKeys (Passed in 23703.45 ms)
- testUsePkpSessionSigsToExecuteJsJsonResponse (Passed in 24800.61 ms)
- testUsePkpSessionSigsToExecuteJsConsoleLog (Passed in 24801.51 ms)
- testUsePkpSessionSigsToEncryptDecryptString (Passed in 23933.89 ms)
- testUsePkpSessionSigsToEncryptDecryptFile (Passed in 36109.91 ms)
- testUsePkpSessionSigsToEncryptDecryptZip (Passed in 36198.72 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning (Passed in 36687.07 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToPkpSign (Passed in 36144.47 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel (Passed in 36174.07 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys (Passed in 35599.49 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys (Passed in 34617.02 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse (Passed in 34513.00 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog (Passed in 35593.07 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString (Passed in 37515.14 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile (Passed in 46438.03 ms)
- testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptZip (Passed in 46165.27 ms)
- testUseInvalidLitActionCodeToGenerateSessionSigs (Passed in 46199.09 ms)
- testDelegatingCapacityCreditsNFTToAnotherWalletToExecuteJs (Passed in 98655.15 ms)
- testDelegatingCapacityCreditsNFTToAnotherWalletToPkpSign (Passed in 97814.61 ms)
- testDelegatingCapacityCreditsNFTToAnotherPkpToExecuteJs (Passed in 94775.61 ms)
- testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToExecuteJs (Passed in 110004.31 ms)
- testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToPkpSign (Passed in 94308.04 ms)
- testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToExecuteJs (Passed in 93923.93 ms)
- testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToPkpSign (Passed in 94233.05 ms)
- testEthAuthSigToEncryptDecryptString (Passed in 132.57 ms)
- testSolAuthSigToEncryptDecryptString (Passed in 159.29 ms)
- testPkpEthersWithEoaSessionSigsToSignWithAuthContext (Passed in 57467.35 ms)
- testPkpEthersWithEoaSessionSigsToSignMessage (Passed in 58214.29 ms)
- testPkpEthersWithEoaSessionSigsToEthSign (Passed in 58210.88 ms)
- testPkpEthersWithEoaSessionSigsToPersonalSign (Passed in 58204.32 ms)
- testPkpEthersWithEoaSessionSigsToSendTx (Passed in 59921.84 ms)
- testPkpEthersWithEoaSessionSigsToEthSignTransaction (Passed in 59384.42 ms)
- testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1 (Passed in 57915.60 ms)
- testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3 (Passed in 70309.94 ms)
- testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4 (Passed in 70232.31 ms)
- testPkpEthersWithEoaSessionSigsToEthSignTypedData (Passed in 70248.00 ms)
- testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil (Passed in 70299.54 ms)
- testPkpEthersWithPkpSessionSigsToSignMessage (Passed in 71289.46 ms)
- testPkpEthersWithPkpSessionSigsToEthSign (Passed in 71293.68 ms)
- testPkpEthersWithPkpSessionSigsToPersonalSign (Passed in 71283.88 ms)
- testPkpEthersWithPkpSessionSigsToSendTx (Passed in 73099.89 ms)
- testPkpEthersWithPkpSessionSigsToEthSignTransaction (Passed in 72851.08 ms)
- testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1 (Passed in 71299.16 ms)
- testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3 (Passed in 83556.85 ms)
- testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4 (Passed in 82480.84 ms)
- testPkpEthersWithPkpSessionSigsToEthSignTypedData (Passed in 83562.44 ms)
- testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil (Passed in 83531.66 ms)
- testPkpEthersWithLitActionSessionSigsToSignMessage (Passed in 83500.21 ms)
- testPkpEthersWithLitActionSessionSigsToEthSign (Passed in 83539.37 ms)
- testPkpEthersWithLitActionSessionSigsToPersonalSign (Passed in 81723.09 ms)
- testPkpEthersWithLitActionSessionSigsToSendTx (Passed in 85819.09 ms)
- testPkpEthersWithLitActionSessionSigsToEthSignTransaction (Passed in 84644.29 ms)
- testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1 (Passed in 83525.51 ms)
- testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3 (Passed in 94594.37 ms)
- testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4 (Passed in 93469.35 ms)
- testPkpEthersWithLitActionSessionSigsToEthSignTypedData (Passed in 94579.85 ms)
- testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil (Passed in 94588.63 ms)
Test Report: All tests passed.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Ansonhkg Ansonhkg requested a review from DashKash54 May 9, 2024 18:24
@Ansonhkg Ansonhkg marked this pull request as ready for review May 9, 2024 18:29
@Ansonhkg Ansonhkg requested a review from joshLong145 as a code owner May 9, 2024 18:29
Copy link
Collaborator

@DashKash54 DashKash54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few questions. Looks good otherwise

Copy link
Contributor

@joshLong145 joshLong145 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. will approve once
https://github.com/LIT-Protocol/js-sdk/pull/459/files#r1596091802
is resolved.

@Ansonhkg
Copy link
Collaborator Author

Looks good. will approve once https://github.com/LIT-Protocol/js-sdk/pull/459/files#r1596091802 is resolved.

#459 (comment)

Copy link
Collaborator

@DashKash54 DashKash54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Ansonhkg
Copy link
Collaborator Author

Looks good. will approve once https://github.com/LIT-Protocol/js-sdk/pull/459/files#r1596091802 is resolved.

merging, as it's approved by adarsh

@Ansonhkg Ansonhkg merged commit abd1eca into feature/lit-2958-auth-unification-ts-tests May 10, 2024
2 checks passed
@Ansonhkg Ansonhkg deleted the fix/pkp-ethers branch May 10, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants