aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-11 00:15:08 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 09:03:18 +0800
commit742660591f66b1bccd194803a1bf1e43a60a3b31 (patch)
tree157e846b5cbde1a847f0d821408d39e3c2e44f73 /src/stores
parentddbcf5f4706a9d75cd5fd4af508f3c07a78f2886 (diff)
downloaddexon-sol-tools-742660591f66b1bccd194803a1bf1e43a60a3b31.tar
dexon-sol-tools-742660591f66b1bccd194803a1bf1e43a60a3b31.tar.gz
dexon-sol-tools-742660591f66b1bccd194803a1bf1e43a60a3b31.tar.bz2
dexon-sol-tools-742660591f66b1bccd194803a1bf1e43a60a3b31.tar.lz
dexon-sol-tools-742660591f66b1bccd194803a1bf1e43a60a3b31.tar.xz
dexon-sol-tools-742660591f66b1bccd194803a1bf1e43a60a3b31.tar.zst
dexon-sol-tools-742660591f66b1bccd194803a1bf1e43a60a3b31.zip
Make a store an instance variable of exchange transfer simulator and stop inheriting it
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/balance_proxy_allowance_lazy_store.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/stores/balance_proxy_allowance_lazy_store.ts b/src/stores/balance_proxy_allowance_lazy_store.ts
index e8178b9a9..7f392cb82 100644
--- a/src/stores/balance_proxy_allowance_lazy_store.ts
+++ b/src/stores/balance_proxy_allowance_lazy_store.ts
@@ -6,7 +6,7 @@ import {TokenWrapper} from '../contract_wrappers/token_wrapper';
* Copy on read store for balances/proxyAllowances of tokens/accounts
*/
export class BalanceAndProxyAllowanceLazyStore {
- protected token: TokenWrapper;
+ private token: TokenWrapper;
private balance: {
[tokenAddress: string]: {
[userAddress: string]: BigNumber,
@@ -22,7 +22,7 @@ export class BalanceAndProxyAllowanceLazyStore {
this.balance = {};
this.proxyAllowance = {};
}
- protected async getBalanceAsync(tokenAddress: string, userAddress: string): Promise<BigNumber> {
+ public async getBalanceAsync(tokenAddress: string, userAddress: string): Promise<BigNumber> {
if (_.isUndefined(this.balance[tokenAddress]) || _.isUndefined(this.balance[tokenAddress][userAddress])) {
const balance = await this.token.getBalanceAsync(tokenAddress, userAddress);
this.setBalance(tokenAddress, userAddress, balance);
@@ -30,13 +30,13 @@ export class BalanceAndProxyAllowanceLazyStore {
const cachedBalance = this.balance[tokenAddress][userAddress];
return cachedBalance;
}
- protected setBalance(tokenAddress: string, userAddress: string, balance: BigNumber): void {
+ public setBalance(tokenAddress: string, userAddress: string, balance: BigNumber): void {
if (_.isUndefined(this.balance[tokenAddress])) {
this.balance[tokenAddress] = {};
}
this.balance[tokenAddress][userAddress] = balance;
}
- protected async getProxyAllowanceAsync(tokenAddress: string, userAddress: string): Promise<BigNumber> {
+ public async getProxyAllowanceAsync(tokenAddress: string, userAddress: string): Promise<BigNumber> {
if (_.isUndefined(this.proxyAllowance[tokenAddress]) ||
_.isUndefined(this.proxyAllowance[tokenAddress][userAddress])) {
const proxyAllowance = await this.token.getProxyAllowanceAsync(tokenAddress, userAddress);
@@ -45,7 +45,7 @@ export class BalanceAndProxyAllowanceLazyStore {
const cachedProxyAllowance = this.proxyAllowance[tokenAddress][userAddress];
return cachedProxyAllowance;
}
- protected setProxyAllowance(tokenAddress: string, userAddress: string, proxyAllowance: BigNumber): void {
+ public setProxyAllowance(tokenAddress: string, userAddress: string, proxyAllowance: BigNumber): void {
if (_.isUndefined(this.proxyAllowance[tokenAddress])) {
this.proxyAllowance[tokenAddress] = {};
}