-
-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add EthKeyringWrapper for common Eth logic around KeyringV2 implementation
#404
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
Changes from 1 commit
e75db9c
c6d1679
5497568
337c3f1
22051b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import { | |
| import { | ||
| EthDecryptParamsStruct, | ||
| EthGetAppKeyAddressParamsStruct, | ||
| EthGetEncryptionPublicKeyParamsStruct, | ||
| EthPersonalSignParamsStruct, | ||
| EthSignEip7702AuthorizationParamsStruct, | ||
| EthSignParamsStruct, | ||
|
|
@@ -79,7 +80,7 @@ export abstract class EthKeyringWrapper< | |
| * @returns The result of the signing operation. | ||
| */ | ||
| async submitRequest(request: KeyringRequest): Promise<Json> { | ||
| const { method, params = [] } = request.request; | ||
| const { method, params } = request.request; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Missing default value for
|
||
|
|
||
| const { address, methods } = await this.getAccount(request.account); | ||
| const hexAddress = this.toHexAddress(address); | ||
|
|
@@ -182,7 +183,9 @@ export abstract class EthKeyringWrapper< | |
| if (!this.inner.getEncryptionPublicKey) { | ||
| throw new Error('Keyring does not support getEncryptionPublicKey'); | ||
| } | ||
| return this.inner.getEncryptionPublicKey(hexAddress); | ||
| assert(params, EthGetEncryptionPublicKeyParamsStruct); | ||
| const [, options] = params; | ||
| return this.inner.getEncryptionPublicKey(hexAddress, options); | ||
| } | ||
|
|
||
| case `${EthKeyringMethod.GetAppKeyAddress}`: { | ||
|
|
@@ -200,10 +203,7 @@ export abstract class EthKeyringWrapper< | |
| } | ||
| assert(params, EthSignEip7702AuthorizationParamsStruct); | ||
| const [authorization] = params; | ||
| return this.inner.signEip7702Authorization( | ||
| hexAddress, | ||
| authorization as [number, Hex, number], | ||
| ); | ||
| return this.inner.signEip7702Authorization(hexAddress, authorization); | ||
| } | ||
|
|
||
| default: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.