diff --git a/packages/mobile/src/identity/commentKey.ts b/packages/mobile/src/identity/commentKey.ts index cf990ae1b62..90a76340082 100644 --- a/packages/mobile/src/identity/commentKey.ts +++ b/packages/mobile/src/identity/commentKey.ts @@ -5,8 +5,8 @@ import { contractKit } from 'src/web3/contracts' export async function getCommentKey(address: string): Promise { const accountsWrapper: AccountsWrapper = await contractKit.contracts.getAccounts() - - const hexString = (await accountsWrapper.getDataEncryptionKey(address)).join() + // getDataEncryptionKey actually returns a string instead of an array + const hexString = [await accountsWrapper.getDataEncryptionKey(address)].join() // No comment key -> empty string returned from getDEK. This is expected for old addresses created before comment encryption change if (!hexString) { return null diff --git a/packages/mobile/src/identity/verification.test.ts b/packages/mobile/src/identity/verification.test.ts index d5a4ccd6fdd..fccfa0a0335 100644 --- a/packages/mobile/src/identity/verification.test.ts +++ b/packages/mobile/src/identity/verification.test.ts @@ -135,8 +135,8 @@ const mockAttestationsWrapperPartlyVerified = { } const mockAccountsWrapper = { - getWalletAddress: jest.fn(() => mockAccount), - getDataEncryptionKey: jest.fn(() => [mockPublicDEK]), + getWalletAddress: jest.fn(() => Promise.resolve(mockAccount)), + getDataEncryptionKey: jest.fn(() => Promise.resolve(mockPublicDEK)), } describe('Start Verification Saga', () => { diff --git a/packages/mobile/src/identity/verification.ts b/packages/mobile/src/identity/verification.ts index 2a8687ad090..d552fc98d12 100644 --- a/packages/mobile/src/identity/verification.ts +++ b/packages/mobile/src/identity/verification.ts @@ -519,7 +519,8 @@ async function isAccountUpToDate( ) { const [currentWalletAddress, currentDEK] = await Promise.all([ accountsWrapper.getWalletAddress(address), - accountsWrapper.getDataEncryptionKey(address), + // getDataEncryptionKey actually returns a string instead of an array + accountsWrapper.getDataEncryptionKey(address).then((key) => [key]), ]) return ( eqAddress(currentWalletAddress, address) && currentDEK && eqAddress(currentDEK.join(), dataKey)