Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/keyring-eth-money/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
17 changes: 0 additions & 17 deletions packages/keyring-eth-money/src/money-keyring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
13 changes: 3 additions & 10 deletions packages/keyring-eth-money/src/money-keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ export const MONEY_KEYRING_TYPE = 'Money Keyring';
export type GetMnemonicCallback = (entropySource: string) => Promise<number[]>;

/**
* 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'];
Expand Down Expand Up @@ -178,7 +177,7 @@ export class MoneyKeyring implements Keyring {
*
* @returns The EVM signer instance.
*/
async #getSigner(): Promise<EvmSigner> {
async #getSigner(): Promise<MoneySigner> {
if (this.#inner) {
return this.#inner;
}
Expand Down Expand Up @@ -222,12 +221,6 @@ export class MoneyKeyring implements Keyring {
return this.#account ? [this.#account] : [];
}

async signTransaction(
...args: Parameters<HdKeyring['signTransaction']>
): ReturnType<HdKeyring['signTransaction']> {
return (await this.#getSigner()).signTransaction(...args);
}

async signPersonalMessage(
...args: Parameters<HdKeyring['signPersonalMessage']>
): ReturnType<HdKeyring['signPersonalMessage']> {
Expand Down
Loading