From 1f12d5eccda78e8f97080a0394dcf7ab018258f3 Mon Sep 17 00:00:00 2001 From: Pasha8914 Date: Tue, 14 Jun 2022 22:00:47 +1000 Subject: [PATCH] fix: remove rudiments --- .../recoverAccountFromChain/getAccountFromAddress.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/account/store/actions/recoverAccountFromChain/getAccountFromAddress.js b/modules/account/store/actions/recoverAccountFromChain/getAccountFromAddress.js index 5cd5b8d..089b111 100644 --- a/modules/account/store/actions/recoverAccountFromChain/getAccountFromAddress.js +++ b/modules/account/store/actions/recoverAccountFromChain/getAccountFromAddress.js @@ -11,8 +11,8 @@ export async function getAccountFromAddress({ getters, rootGetters }, address) { const events = await getEventsFromBlockPart({ netId, - currentBlockNumber, address, + currentBlockNumber, echoContract: getters.echoContract }) @@ -22,15 +22,12 @@ export async function getAccountFromAddress({ getters, rootGetters }, address) { throw new Error(`Please setup account, account doesn't exist for this address`) } - const data = lastEvent.encryptedAccount ? lastEvent.encryptedAccount : lastEvent.returnValues.data - const backup = lastEvent.address ? lastEvent.address : lastEvent.returnValues.who - - const encryptedMessage = unpackEncryptedMessage(data) + const encryptedMessage = unpackEncryptedMessage(lastEvent.encryptedAccount) const encryptedKey = Buffer.from(JSON.stringify(encryptedMessage)).toString('hex') return { - backup, - encryptedKey + encryptedKey, + backup: lastEvent.address } } catch (err) { throw new Error(`Method getAccountFromAddress has error: ${err.message}`)