Merge branch 'development' into feature/ts-ethers

This commit is contained in:
Leonid Logvinov
2018-09-26 14:55:52 +02:00
164 changed files with 3112 additions and 1096 deletions

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "contracts",
"version": "2.1.44",
"version": "2.1.47",
"engines": {
"node": ">=6.12"
},
@@ -45,16 +45,16 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md",
"devDependencies": {
"@0xproject/abi-gen": "^1.0.8",
"@0xproject/dev-utils": "^1.0.7",
"@0xproject/sol-compiler": "^1.1.2",
"@0xproject/sol-cov": "^2.1.2",
"@0xproject/subproviders": "^2.0.2",
"@0xproject/abi-gen": "^1.0.11",
"@0xproject/dev-utils": "^1.0.10",
"@0xproject/sol-compiler": "^1.1.5",
"@0xproject/sol-cov": "^2.1.5",
"@0xproject/subproviders": "^2.0.5",
"@0xproject/tslint-config": "^1.0.7",
"@types/bn.js": "^4.11.0",
"@types/ethereumjs-abi": "^0.6.0",
"@types/lodash": "4.14.104",
"@types/node": "^8.0.53",
"@types/node": "*",
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
@@ -72,15 +72,15 @@
"yargs": "^10.0.3"
},
"dependencies": {
"@0xproject/base-contract": "^2.0.2",
"@0xproject/order-utils": "^1.0.2",
"@0xproject/types": "^1.0.1",
"@0xproject/typescript-typings": "^2.0.0",
"@0xproject/utils": "^1.0.8",
"@0xproject/web3-wrapper": "^2.0.2",
"@0xproject/base-contract": "^2.0.5",
"@0xproject/order-utils": "^1.0.5",
"@0xproject/types": "^1.1.1",
"@0xproject/typescript-typings": "^2.0.2",
"@0xproject/utils": "^1.0.11",
"@0xproject/web3-wrapper": "^3.0.1",
"@types/js-combinatorics": "^0.5.29",
"bn.js": "^4.11.8",
"ethereum-types": "^1.0.6",
"ethereum-types": "^1.0.8",
"ethereumjs-abi": "0.6.5",
"ethereumjs-util": "^5.1.1",
"ethers": "^4.0.0-beta.14",

View File

@@ -269,7 +269,10 @@ describe('MultiSigWalletWithTimeLock', () => {
expect(confirmRes.logs).to.have.length(2);
const blockNum = await web3Wrapper.getBlockNumberAsync();
const blockInfo = await web3Wrapper.getBlockAsync(blockNum);
const blockInfo = await web3Wrapper.getBlockIfExistsAsync(blockNum);
if (_.isUndefined(blockInfo)) {
throw new Error(`Unexpectedly failed to fetch block at #${blockNum}`);
}
const timestamp = new BigNumber(blockInfo.timestamp);
const confirmationTimeBigNum = new BigNumber(await multiSig.confirmationTimes.callAsync(txId));

View File

@@ -35,6 +35,9 @@ export async function increaseTimeAndMineBlockAsync(seconds: number): Promise<nu
* @returns a new Promise which will resolve with the timestamp in seconds.
*/
export async function getLatestBlockTimestampAsync(): Promise<number> {
const currentBlock = await web3Wrapper.getBlockAsync('latest');
return currentBlock.timestamp;
const currentBlockIfExists = await web3Wrapper.getBlockIfExistsAsync('latest');
if (_.isUndefined(currentBlockIfExists)) {
throw new Error(`Unable to fetch latest block.`);
}
return currentBlockIfExists.timestamp;
}