diff --git a/packages/keyring-eth-money/CHANGELOG.md b/packages/keyring-eth-money/CHANGELOG.md index e25bd951..895129f5 100644 --- a/packages/keyring-eth-money/CHANGELOG.md +++ b/packages/keyring-eth-money/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **BREAKING:** Remove `signTransaction` pass-through; Money accounts do not sign transactions ([#521](https://github.com/MetaMask/accounts/pull/521)) + - Unexport `EvmSigner` type and rename to `MoneySigner`; the type was incorrectly exported and didn't represent a full EVM signer. - Bump `@metamask/keyring-utils` from `^3.2.0` to `^3.3.1` ([#544](https://github.com/MetaMask/accounts/pull/544), [#546](https://github.com/MetaMask/accounts/pull/546)) ## [2.0.4] diff --git a/packages/keyring-eth-money/src/money-keyring.test.ts b/packages/keyring-eth-money/src/money-keyring.test.ts index 170bc632..e55e4392 100644 --- a/packages/keyring-eth-money/src/money-keyring.test.ts +++ b/packages/keyring-eth-money/src/money-keyring.test.ts @@ -397,23 +397,6 @@ describe('MoneyKeyring', () => { expect(signature).toMatch(/^0x[0-9a-f]+$/u); }); - it('signTransaction delegates to the inner keyring', async () => { - const { HdKeyring } = await import('@metamask/eth-hd-keyring'); - const mockSignature = '0xsignature'; - const spy = jest - .spyOn(HdKeyring.prototype, 'signTransaction') - .mockResolvedValue(mockSignature as never); - - const keyring = createKeyring(); - await keyring.deserialize(mockState); - - const mockTx = {} as never; - const result = await keyring.signTransaction(mockAccount, mockTx); - - expect(spy).toHaveBeenCalledWith(mockAccount, mockTx); - expect(result).toBe(mockSignature); - }); - it('signTypedData delegates to the inner keyring', async () => { const { HdKeyring } = await import('@metamask/eth-hd-keyring'); const mockSignature = '0xsignature'; diff --git a/packages/keyring-eth-money/src/money-keyring.ts b/packages/keyring-eth-money/src/money-keyring.ts index cf65c40e..8ff94d3d 100644 --- a/packages/keyring-eth-money/src/money-keyring.ts +++ b/packages/keyring-eth-money/src/money-keyring.ts @@ -31,10 +31,9 @@ export const MONEY_KEYRING_TYPE = 'Money Keyring'; export type GetMnemonicCallback = (entropySource: string) => Promise; /** - * EVM signer interface, a subset of {@link HdKeyring} methods. + * Signing interface for Money accounts, a subset of {@link HdKeyring} methods. */ -export type EvmSigner = { - signTransaction: HdKeyring['signTransaction']; +type MoneySigner = { signPersonalMessage: HdKeyring['signPersonalMessage']; signTypedData: HdKeyring['signTypedData']; signEip7702Authorization: HdKeyring['signEip7702Authorization']; @@ -178,7 +177,7 @@ export class MoneyKeyring implements Keyring { * * @returns The EVM signer instance. */ - async #getSigner(): Promise { + async #getSigner(): Promise { if (this.#inner) { return this.#inner; } @@ -222,12 +221,6 @@ export class MoneyKeyring implements Keyring { return this.#account ? [this.#account] : []; } - async signTransaction( - ...args: Parameters - ): ReturnType { - return (await this.#getSigner()).signTransaction(...args); - } - async signPersonalMessage( ...args: Parameters ): ReturnType {