({decryptImpl, verifyImpl})
| 57 | const utf8Binary = str => Uint8Array2str(new TextEncoder().encode(str)); |
| 58 | |
| 59 | function makeFakeKeyring({decryptImpl, verifyImpl}) { |
| 60 | return { |
| 61 | getPgpBackend: () => ({ |
| 62 | decrypt: decryptImpl, |
| 63 | verify: verifyImpl |
| 64 | }), |
| 65 | getPrivateKeyByIds: jest.fn(), |
| 66 | keystore: { |
| 67 | getAllKeys: jest.fn().mockReturnValue([]), |
| 68 | getKeysForId: jest.fn().mockReturnValue([]) |
| 69 | }, |
| 70 | getFprForKeyId: jest.fn(), |
| 71 | getKeyByAddress: jest.fn().mockResolvedValue({}) |
| 72 | }; |
| 73 | } |
| 74 | |
| 75 | beforeAll(() => { |
| 76 | l10n.mapToLocal(); |