Skip to content

Commit

Permalink
fix: merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
druiz0992 committed Nov 22, 2021
2 parents 6e882eb + b432486 commit eae9a68
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 31 deletions.
2 changes: 1 addition & 1 deletion common-files/classes/transaction.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function keccak(preimage) {
// compute the solidity hash, using suitable type conversions
return web3.utils.soliditySha3(
{ t: 'uint64', v: preimage.value },
...preimage.historicRootBlockNumberL2.map(hi => ({ t: 'uint64', v: hi })),
...preimage.historicRootBlockNumberL2.map(hi => ({ t: 'uint256', v: hi })),
{ t: 'uint8', v: preimage.transactionType },
{ t: 'uint8', v: preimage.tokenType },
{ t: 'bytes32', v: preimage.publicInputHash },
Expand Down
2 changes: 2 additions & 0 deletions wallet/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const METAMASK_MESSAGE =

const TRANSACTION_MAX_RETRIES = 10;
const TRANSACTION_RETRY_PERIOD = 10000; // 10s
const BALANCE_INTERVAL = 30000;

export {
DEFAULT_NF_ADDRESS_INDEX,
Expand All @@ -37,4 +38,5 @@ export {
METAMASK_MESSAGE,
TRANSACTION_MAX_RETRIES,
TRANSACTION_RETRY_PERIOD,
BALANCE_INTERVAL,
};
2 changes: 1 addition & 1 deletion wallet/src/views/login/login.view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function Login({ login, settings, onLoadWallet, onDeleteWallet }) {
}
} catch (err) {
// TODO
console.log('ERROR');
console.log('ERROR', err);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from '../../../../store/token/token.actions';
import { TokenAddModal } from './token-add.view.jsx';
import * as Storage from '../../../../utils/lib/local-storage';
import * as Constant from '../../../../constants';

function WalletInfo({ login, token, onAddToken, onSelectToken, onUnselectToken, onDeleteToken }) {
const [modalTokenAddEnable, setModalTokenAddEnable] = React.useState(false);
Expand Down Expand Up @@ -117,6 +118,10 @@ function WalletInfo({ login, token, onAddToken, onSelectToken, onUnselectToken,

React.useEffect(() => {
reload();
const retrieveBalance = setInterval(() => {
reload();
}, Constant.BALANCE_INTERVAL);
return () => clearInterval(retrieveBalance);
}, []);

const handleOnTokenAddSubmit = (tokenName, tokenType, tokenAddress) => {
Expand All @@ -142,40 +147,40 @@ function WalletInfo({ login, token, onAddToken, onSelectToken, onUnselectToken,

return (
<Container>
<Table padded>
<Table padded fixed selectable>
<Table.Header>
<Table.Row>
<Table.HeaderCell colSpan="4" textAlign="left">
<Table.HeaderCell colSpan="4">
<Table.Cell>Account Address:</Table.Cell>
<Table.Cell id="wallet-info-cell-ethaddress"> {importedWallet()} </Table.Cell>
</Table.HeaderCell>
<Table.HeaderCell textAlign="right">
<Button
onClick={reload}
id="wallet-info-cell-reload"
disabled={token.activeTokenRowId === ''}
>
<Icon name="sync" />
Reload
</Button>
</Table.HeaderCell>
<Table.HeaderCell textAlign="right">
<Button onClick={toggleModalTokenAdd} id="wallet-info-cell-add-token">
<Icon name="plus" />
Add Token
</Button>
</Table.HeaderCell>
<Table.HeaderCell textAlign="right">
<Button
toggle
onClick={removeToken}
id="wallet-info-cell-remove-token"
active={removeTokenEnable && token.tokenPool.length}
disabled={token.tokenPool.length === 0}
>
{' '}
<Icon name="minus" /> Remove Token{' '}
</Button>
<Table.HeaderCell colSpan="3">
<Table.Cell />
<Table.Cell />
<Table.Cell>
<Button
icon
labelPosition="left"
onClick={toggleModalTokenAdd}
id="wallet-info-cell-add-token"
>
<Icon name="plus" />
Add Token
</Button>
</Table.Cell>
<Table.Cell>
<Button
icon
labelPosition="left"
id="wallet-info-cell-remove-token"
toggle
onClick={removeToken}
active={removeTokenEnable && token.tokenPool.length}
disabled={token.tokenPool.length === 0}
>
<Icon name="minus" /> Remove Token
</Button>
</Table.Cell>
</Table.HeaderCell>
</Table.Row>
</Table.Header>
Expand Down

0 comments on commit eae9a68

Please sign in to comment.