aboutsummaryrefslogtreecommitdiffstats
path: root/contracts/exchange/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts
diff options
context:
space:
mode:
Diffstat (limited to 'contracts/exchange/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts')
-rw-r--r--contracts/exchange/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/contracts/exchange/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts b/contracts/exchange/test/utils/simple_asset_balance_and_proxy_allowance_fetcher.ts
new file mode 100644
index 000000000..64b7dedbe
--- /dev/null
+++ b/contracts/exchange/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;
+ }
+}