diff --git a/app/scripts/controllers/encryption-public-key.test.ts b/app/scripts/controllers/encryption-public-key.test.ts index cc5b61cc1..cb5581831 100644 --- a/app/scripts/controllers/encryption-public-key.test.ts +++ b/app/scripts/controllers/encryption-public-key.test.ts @@ -352,6 +352,15 @@ describe('EncryptionPublicKeyController', () => { 'Cancel', ); }); + + it('returns current state', async () => { + getStateMock.mockReturnValueOnce(stateMock); + expect( + await encryptionPublicKeyController.cancelEncryptionPublicKey( + messageIdMock, + ), + ).toEqual(stateMock); + }); }); describe('message manager events', () => { diff --git a/app/scripts/controllers/encryption-public-key.ts b/app/scripts/controllers/encryption-public-key.ts index 626413b3f..4ea2c1afe 100644 --- a/app/scripts/controllers/encryption-public-key.ts +++ b/app/scripts/controllers/encryption-public-key.ts @@ -275,7 +275,7 @@ export default class EncryptionPublicKeyController extends BaseControllerV2< * @param msgId - The id of the message to cancel. */ cancelEncryptionPublicKey(msgId: string) { - this._cancelAbstractMessage(this._encryptionPublicKeyManager, msgId); + return this._cancelAbstractMessage(this._encryptionPublicKeyManager, msgId); } /**