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
5 changes: 5 additions & 0 deletions packages/keyring-eth-money-mpc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Call `check-key-share` with `GET` instead of `POST` ([#717](https://github.com/MetaMask/accounts/pull/717))
- Requires an MPC backend that serves `GET /v1/check-key-share`.

## [0.4.0]

### Changed
Expand Down
8 changes: 8 additions & 0 deletions packages/keyring-eth-money-mpc/src/cloud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,14 @@ describe('cloud helpers', () => {
latestBackupEpoch: 2,
activeEpoch: 1,
});

expect(fetchSpy).toHaveBeenCalledWith(
'https://cloud.example/check-key-share',
expect.objectContaining({
method: 'GET',
headers: { Authorization: 'Bearer token-1' },
}),
);
});

it('rejects key share epoch metadata with the wrong shape', async () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/keyring-eth-money-mpc/src/cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,9 @@ export async function checkKeyShare(opts: {
token: string;
}): Promise<CheckKeyShareResult> {
return readStruct(
await postJson(
await getJson(
`${opts.baseURL}/check-key-share`,
opts.token,
{},
'Failed to check key share',
),
CheckKeyShareResponseStruct,
Expand Down
Loading