diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-11 06:37:48 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-12-11 06:44:49 +0800 |
commit | 9f5eeed30930eea59e9922569a15cb5d689f3eeb (patch) | |
tree | 74dac8603dae440bcaa28245fd5af49815284840 /contracts/protocol/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts | |
parent | 14ea4ee1d3fd1a34c1747b928d9b463787e603e7 (diff) | |
download | dexon-sol-tools-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar dexon-sol-tools-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.gz dexon-sol-tools-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.bz2 dexon-sol-tools-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.lz dexon-sol-tools-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.xz dexon-sol-tools-9f5eeed30930eea59e9922569a15cb5d689f3eeb.tar.zst dexon-sol-tools-9f5eeed30930eea59e9922569a15cb5d689f3eeb.zip |
Rename core package to protocol
Diffstat (limited to 'contracts/protocol/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts')
-rw-r--r-- | contracts/protocol/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/contracts/protocol/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts b/contracts/protocol/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts new file mode 100644 index 000000000..64b7dedbe --- /dev/null +++ b/contracts/protocol/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts @@ -0,0 +1,19 @@ +import { AbstractBalanceAndProxyAllowanceFetcher } from '@0x/order-utils'; +import { BigNumber } from '@0x/utils'; + +import { AssetWrapper } from './asset_wrapper'; + +export class SimpleAssetBalanceAndProxyAllowanceFetcher implements AbstractBalanceAndProxyAllowanceFetcher { + private readonly _assetWrapper: AssetWrapper; + constructor(assetWrapper: AssetWrapper) { + this._assetWrapper = assetWrapper; + } + public async getBalanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { + const balance = await this._assetWrapper.getBalanceAsync(userAddress, assetData); + return balance; + } + public async getProxyAllowanceAsync(assetData: string, userAddress: string): Promise<BigNumber> { + const proxyAllowance = await this._assetWrapper.getProxyAllowanceAsync(userAddress, assetData); + return proxyAllowance; + } +} |