aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-12-05 15:13:48 +0800
committerJacob Evans <jacob@dekz.net>2018-12-05 15:13:48 +0800
commit740b73276f67733226542fb219d18cf7d513bdaa (patch)
treeb8d13ea7d4777db7300b57face821898014236e0
parent2f50cca480092c14d5a8737f50aa08c99ae825b4 (diff)
downloaddexon-sol-tools-740b73276f67733226542fb219d18cf7d513bdaa.tar
dexon-sol-tools-740b73276f67733226542fb219d18cf7d513bdaa.tar.gz
dexon-sol-tools-740b73276f67733226542fb219d18cf7d513bdaa.tar.bz2
dexon-sol-tools-740b73276f67733226542fb219d18cf7d513bdaa.tar.lz
dexon-sol-tools-740b73276f67733226542fb219d18cf7d513bdaa.tar.xz
dexon-sol-tools-740b73276f67733226542fb219d18cf7d513bdaa.tar.zst
dexon-sol-tools-740b73276f67733226542fb219d18cf7d513bdaa.zip
chore: Remove increaseTimeAsync from DutchAuction.
Dutch auctions can be made in the past so we do not need to artificially increase time
-rw-r--r--contracts/core/test/extensions/dutch_auction.ts39
1 files changed, 0 insertions, 39 deletions
diff --git a/contracts/core/test/extensions/dutch_auction.ts b/contracts/core/test/extensions/dutch_auction.ts
index 6bed222f4..54e6092d7 100644
--- a/contracts/core/test/extensions/dutch_auction.ts
+++ b/contracts/core/test/extensions/dutch_auction.ts
@@ -62,16 +62,6 @@ describe(ContractName.DutchAuction, () => {
let erc721MakerAssetIds: BigNumber[];
const tenMinutesInSeconds = 10 * 60;
- async function increaseTimeAsync(): Promise<void> {
- const timestampBefore = await getLatestBlockTimestampAsync();
- await web3Wrapper.increaseTimeAsync(5);
- const timestampAfter = await getLatestBlockTimestampAsync();
- // HACK send some transactions when a time increase isn't supported
- if (timestampAfter === timestampBefore) {
- await web3Wrapper.sendTransactionAsync({ to: makerAddress, from: makerAddress, value: new BigNumber(1) });
- }
- }
-
function extendMakerAssetData(makerAssetData: string, beginTimeSeconds: BigNumber, beginAmount: BigNumber): string {
return ethUtil.bufferToHex(
Buffer.concat([
@@ -276,34 +266,6 @@ describe(ContractName.DutchAuction, () => {
erc20Balances[takerAddress][wethContract.address].minus(beforeAuctionDetails.currentAmount),
);
});
- it('should have valid getAuctionDetails at some block in the future', async () => {
- let auctionDetails = await dutchAuctionContract.getAuctionDetails.callAsync(sellOrder);
- const beforeAmount = auctionDetails.currentAmount;
- await increaseTimeAsync();
- auctionDetails = await dutchAuctionContract.getAuctionDetails.callAsync(sellOrder);
- const currentAmount = auctionDetails.currentAmount;
- expect(beforeAmount).to.be.bignumber.greaterThan(currentAmount);
-
- buyOrder = await buyerOrderFactory.newSignedOrderAsync({
- makerAssetAmount: currentAmount,
- });
- const txHash = await dutchAuctionContract.matchOrders.sendTransactionAsync(
- buyOrder,
- sellOrder,
- buyOrder.signature,
- sellOrder.signature,
- {
- from: takerAddress,
- // HACK geth seems to miscalculate the gas required intermittently
- gas: 400000,
- },
- );
- await web3Wrapper.awaitTransactionSuccessAsync(txHash);
- const newBalances = await erc20Wrapper.getBalancesAsync();
- expect(newBalances[makerAddress][wethContract.address]).to.be.bignumber.equal(
- erc20Balances[makerAddress][wethContract.address].plus(currentAmount),
- );
- });
it('maker fees on sellOrder are paid to the fee receipient', async () => {
sellOrder = await sellerOrderFactory.newSignedOrderAsync({
makerFee: new BigNumber(1),
@@ -375,7 +337,6 @@ describe(ContractName.DutchAuction, () => {
);
});
it('cannot be filled for less than the current price', async () => {
- await increaseTimeAsync();
buyOrder = await buyerOrderFactory.newSignedOrderAsync({
makerAssetAmount: sellOrder.takerAssetAmount,
});