Fix slow balances (#6471)

* Update token updates

* Update token info fetching

* Update logger

* Minor fixes to updates and notifications for balances

* Use Pubsub

* Fix timeout.

* Use pubsub for status.

* Fix signer subscription.

* Process tokens in chunks.

* Fix tokens loaded by chunks

* Linting

* Dispatch tokens asap

* Fix chunks processing.

* Better filter options

* Parallel log fetching.

* Fix signer polling.

* Fix initial block query.

* Token balances updates : the right(er) way

* Better tokens info fetching

* Fixes in token data fetching

* Only fetch what's needed (tokens)

* Fix linting issues

* Revert "Transaction permissioning (#6441)"

This reverts commit eed0e8b03a.

* Revert "Revert "Transaction permissioning (#6441)""

This reverts commit 8f96415e58dde652e5828706eb2639d43416f448.

* Update wasm-tests.

* Fixing balances fetching

* Fix requests tracking in UI

* Fix request watching

* Update the Logger

* PR Grumbles Fixes

* PR Grumbles fixes

* Linting...
This commit is contained in:
Nicolas Gotchac
2017-09-10 18:03:35 +02:00
committed by Gav Wood
parent ee14a3fb31
commit f1a050366f
51 changed files with 1819 additions and 857 deletions

View File

@@ -50,6 +50,20 @@ export class Balance extends Component {
}
let body = Object.keys(balance)
.sort((tokenIdA, tokenIdB) => {
const tokenA = tokens[tokenIdA];
const tokenB = tokens[tokenIdB];
if (tokenA.native) {
return -1;
}
if (tokenB.native) {
return 1;
}
return (tokenA.name || tokenA.tag || '').localeCompare(tokenB.name || tokenB.tag || '');
})
.map((tokenId) => {
const token = tokens[tokenId];
const balanceValue = balance[tokenId];
@@ -73,7 +87,8 @@ export class Balance extends Component {
decimals = 1;
}
const value = new BigNumber(balanceValue).div(bnf).toFormat(decimals);
const rawValue = new BigNumber(balanceValue).div(bnf);
const value = rawValue.toFormat(decimals);
const classNames = [styles.balance];
let details = null;
@@ -85,7 +100,7 @@ export class Balance extends Component {
className={ styles.value }
key='value'
>
<span title={ value }>
<span title={ `${rawValue.toFormat()} ${token.tag}` }>
{ value }
</span>
</div>,

View File

@@ -23,7 +23,7 @@ import Api from '~/api';
import TxRow from './txRow';
const api = new Api({ execute: sinon.stub() });
const api = new Api({ execute: sinon.stub(), on: sinon.stub() });
const STORE = {
dispatch: sinon.stub(),

View File

@@ -22,7 +22,7 @@ import Api from '~/api';
import TxList from './txList';
const api = new Api({ execute: sinon.stub() });
const api = new Api({ execute: sinon.stub(), on: sinon.stub() });
const STORE = {
dispatch: sinon.stub(),