Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
taitt committed May 3, 2018
1 parent dc5bd3b commit dcd728c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"d3": "4.12.0",
"ethereumjs-ledger": "2.1.4",
"ethereumjs-tx": "1.3.3",
"ethereumjs-util": "^5.2.0",
"express": "4.16.2",
"helmet": "3.9.0",
"highcharts": "6.0.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { toChecksumAddress } from 'ethereumjs-util'
import { augur } from 'services/augurjs'
import { loadAccountData } from 'modules/auth/actions/load-account-data'
import { updateIsLogged } from 'modules/auth/actions/update-is-logged'
Expand All @@ -6,9 +7,10 @@ import { clearLoginAccount } from 'modules/auth/actions/update-login-account'
export const updateIsLoggedAndLoadAccountData = (unlockedAddress, accountType) => (dispatch) => {
augur.rpc.clear() // clear ethrpc transaction history, registered callbacks, and notifications
dispatch(clearLoginAccount()) // clear the loginAccount data in local state
const address = toChecksumAddress(unlockedAddress)
const loginAccount = {
address: unlockedAddress,
meta: { accountType, address: unlockedAddress, signer: null },
address,
meta: { accountType, address, signer: null },
}
dispatch(updateIsLogged(true))
dispatch(loadAccountData(loginAccount))
Expand Down
4 changes: 2 additions & 2 deletions test/auth/actions/update-is-logged-and-load-account-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe(`modules/auth/actions/update-is-logged-and-load-account-data.js`, () =>
{ type: 'AUGURJS_RPC_CLEAR' },
{ type: 'CLEAR_LOGIN_ACCOUNT' },
{ type: 'UPDATE_IS_LOGGED', data: { isLogged: true } },
{ type: 'LOAD_ACCOUNT_DATA', account: { address: '0xb0b', meta: { accountType: 'unlockedEthereumNode', address: '0xb0b', signer: null } } },
{ type: 'LOAD_ACCOUNT_DATA', account: { address: '0xB0B', meta: { accountType: 'unlockedEthereumNode', address: '0xB0B', signer: null } } },
]),
})
test({
Expand All @@ -45,7 +45,7 @@ describe(`modules/auth/actions/update-is-logged-and-load-account-data.js`, () =>
{ type: 'AUGURJS_RPC_CLEAR' },
{ type: 'CLEAR_LOGIN_ACCOUNT' },
{ type: 'UPDATE_IS_LOGGED', data: { isLogged: true } },
{ type: 'LOAD_ACCOUNT_DATA', account: { address: '0xb0b', meta: { accountType: 'metaMask', address: '0xb0b', signer: null } } },
{ type: 'LOAD_ACCOUNT_DATA', account: { address: '0xB0B', meta: { accountType: 'metaMask', address: '0xB0B', signer: null } } },
]),
})
})

0 comments on commit dcd728c

Please sign in to comment.