simulate maker and taker balances of erc20

This commit is contained in:
Noah Khamliche
2022-08-19 15:13:38 -04:00
parent 1170c90141
commit c82ce2bdf9
3 changed files with 6 additions and 3 deletions

View File

@@ -100,7 +100,6 @@ contract OtcOrdersFeature is
returns (uint128 takerTokenFilledAmount, uint128 makerTokenFilledAmount)
{
LibNativeOrder.OtcOrderInfo memory orderInfo = getOtcOrderInfo(order);
revert("otcOrder");
_validateOtcOrder(
order,
orderInfo,

View File

@@ -436,7 +436,6 @@ contract FillQuoteTransformer is
),
orderInfo.maxTakerTokenFillAmount
);
try
zeroEx.fillOtcOrder
(

View File

@@ -24,6 +24,7 @@ import {
Signature,
} from '@0x/protocol-utils';
import { BigNumber, hexUtils, ZeroExRevertErrors } from '@0x/utils';
import { assert } from 'chai';
import { TransactionReceiptWithDecodedLogs as TxReceipt } from 'ethereum-types';
import { ethers } from 'ethers';
import * as _ from 'lodash';
@@ -704,7 +705,11 @@ blockchainTests.resets('FillQuoteTransformer', env => {
it.only('can fully buy to a single OTC order', async () => {
const ethersMakerWallet = ethers.Wallet.createRandom();
const _otcOrder = createOtcOrder({maker: ethersMakerWallet.address})
const _otcOrder = createOtcOrder({maker: ethersMakerWallet.address});
await makerToken.mint(ethersMakerWallet.address, MAX_UINT256).awaitTransactionSuccessAsync();
await takerToken.mint(taker, MAX_UINT256).awaitTransactionSuccessAsync();
let balMaker = await makerToken.balanceOf(ethersMakerWallet.address).callAsync();
let balTaker = await takerToken.balanceOf(taker).callAsync();
const otcOrders = [_otcOrder];
const totalTakerTokens = BigNumber.sum(...otcOrders.map(o => o.takerAmount));
const _otcOrderSignature = await ethersMakerWallet.signMessage(ethers.utils.arrayify(_otcOrder.getHash()));