Skip to content

Commit

Permalink
chore: Update deps (#64)
Browse files Browse the repository at this point in the history
* update ganache to latest

* Fix test adding 27 to V, which doesn't appear to be required anymore

* Remove merkle-patricia-tree resolution

* bump lodash

* CHANGELOG

* remove echo
  • Loading branch information
dekz authored Aug 2, 2022
1 parent 7e7e6dc commit 27955e3
Show file tree
Hide file tree
Showing 24 changed files with 3,500 additions and 3,153 deletions.
4 changes: 2 additions & 2 deletions abi-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"prettier_contract_wrappers": "prettier --write ./test-cli/output/typescript/* --config ../.prettierrc",
"generate_contract_wrappers": "run-p gen_typescript gen_python",
"gen_typescript": "abi-gen --abis ${npm_package_config_abis} --debug --output ./test-cli/output/typescript --backend ethers",
"gen_python": "pip install regex==2019.11.1 && pip install black && abi-gen --abis ${npm_package_config_abis} --output ./test-cli/output/python --language Python",
"gen_python": "pip install regex==2019.11.1 && pip install black && abi-gen --abis ${npm_package_config_abis} --output ./test-cli/output/python --language Python",
"diff_contract_wrappers": "git diff --exit-code ./test-cli/output",
"coverage:report:text": "istanbul report text",
"coverage:report:html": "istanbul report html && open coverage/index.html",
Expand Down Expand Up @@ -73,7 +73,7 @@
"ethereum-types": "^3.7.0",
"glob": "^7.1.2",
"handlebars": "^4.1.2",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"mkdirp": "^0.5.1",
"tmp": "^0.0.33",
"to-snake-case": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe('AbiGenDummy Contract', () => {
const r = `0x${signature.slice(2, 66)}`;
const s = `0x${signature.slice(66, 130)}`;
const v = signature.slice(130, 132);
const v_decimal = parseInt(v, 16) + 27; // v: (0 or 1) => (27 or 28)
const v_decimal = parseInt(v, 16);
// tslint:enable:custom-no-magic-numbers

const result = await abiGenDummy.ecrecoverFn(message, v_decimal, r, s).callAsync();
Expand Down
2 changes: 1 addition & 1 deletion assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@0x/typescript-typings": "^5.3.1",
"@0x/utils": "^6.5.3",
"@types/node": "12.12.54",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"valid-url": "^1.0.9"
},
"publishConfig": {
Expand Down
9 changes: 9 additions & 0 deletions base-contract/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "7.0.0",
"changes": [
{
"note": "Update downstream dependencies to latest versions",
"pr": 64
}
]
},
{
"version": "6.5.0",
"changes": [
Expand Down
8 changes: 2 additions & 6 deletions base-contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,13 @@
"@0x/utils": "^6.5.3",
"@0x/web3-wrapper": "^7.6.5",
"@types/node": "12.12.54",
"ethereumjs-account": "^3.0.0",
"ethereumjs-blockstream": "^7.0.0",
"ethereumjs-util": "^7.1.0",
"ethereumjs-vm": "^4.2.0",
"ethereumjs-util": "^7.1.5",
"@ethereumjs/vm": "^5.9.3",
"ethers": "~4.0.4",
"js-sha3": "^0.7.0",
"uuid": "^3.3.2"
},
"resolutions": {
"merkle-patricia-tree": "^2.3.2"
},
"publishConfig": {
"access": "public"
},
Expand Down
34 changes: 18 additions & 16 deletions base-contract/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import {
TxData,
TxDataPayable,
} from 'ethereum-types';
import Account from 'ethereumjs-account';
import * as util from 'ethereumjs-util';
import { default as VM } from 'ethereumjs-vm';
import PStateManager from 'ethereumjs-vm/dist/state/promisified';
import VM from '@ethereumjs/vm';

export { linkLibrariesInBytecode, methodAbiToFunctionSignature } from './utils';

import { AwaitTransactionSuccessOpts } from './types';
import { formatABIDataItem } from './utils';
import { RunCallOpts } from '@ethereumjs/vm/dist/runCall';
import Common, { Chain, Hardfork } from '@ethereumjs/common';

export { SubscriptionManager } from './subscription_manager';

Expand Down Expand Up @@ -77,7 +77,7 @@ export class PromiseWithTransactionHash<T> implements Promise<T> {
public catch<TResult>(onRejected?: (reason: any) => Promise<TResult>): Promise<TResult | T> {
return this._promise.catch(onRejected);
}
public finally(onFinally?: (() => void) | null): Promise<T> {
public finally(onFinally?: () => void | null): Promise<T> {
return this._promise.finally(onFinally);
}
// tslint:enable:promise-function-async
Expand All @@ -102,7 +102,7 @@ export class BaseContract {
public constructorArgs: any[] = [];
public _deployedBytecodeIfExists?: Buffer;
private _evmIfExists?: VM;
private _evmAccountIfExists?: Buffer;
private _evmAccountIfExists?: util.Address;

protected static _formatABIDataItemList(
abis: DataItem[],
Expand Down Expand Up @@ -190,7 +190,9 @@ export class BaseContract {
const decoded = rawDecoded[i];
if (!abiUtils.isAbiDataEqual(params.names[i], params.types[i], original, decoded)) {
throw new Error(
`Cannot safely encode argument: ${params.names[i]} (${original}) of type ${params.types[i]}. (Possible type overflow or other encoding error)`,
`Cannot safely encode argument: ${params.names[i]} (${original}) of type ${
params.types[i]
}. (Possible type overflow or other encoding error)`,
);
}
}
Expand Down Expand Up @@ -260,37 +262,37 @@ export class BaseContract {
}
protected async _evmExecAsync(encodedData: string): Promise<string> {
const encodedDataBytes = Buffer.from(encodedData.substr(2), 'hex');
const addressBuf = Buffer.from(this.address.substr(2), 'hex');
const toAddress = new util.Address(Buffer.from(this.address.substr(2), 'hex'));
// should only run once, the first time it is called
if (this._evmIfExists === undefined) {
const vm = new VM({});
const psm = new PStateManager(vm.stateManager);
const vm = new VM();

// create an account with 1 ETH
const accountPk = Buffer.from(ARBITRARY_PRIVATE_KEY, 'hex');
const accountAddress = util.privateToAddress(accountPk);
const account = new Account({ balance: 1e18 });
await psm.putAccount(accountAddress, account);
const accountAddress = new util.Address(util.privateToAddress(accountPk));
const account = util.Account.fromAccountData({ balance: '0xde0b6b3a7640000' });
await vm.stateManager.putAccount(accountAddress, account);

// 'deploy' the contract
if (this._deployedBytecodeIfExists === undefined) {
const contractCode = await this._web3Wrapper.getContractCodeAsync(this.address);
this._deployedBytecodeIfExists = Buffer.from(contractCode.substr(2), 'hex');
}
await psm.putContractCode(addressBuf, this._deployedBytecodeIfExists);
await vm.stateManager.putContractCode(toAddress, this._deployedBytecodeIfExists);

// save for later
this._evmIfExists = vm;
this._evmAccountIfExists = accountAddress;
}
let rawCallResult;
try {
const result = await this._evmIfExists.runCall({
to: addressBuf,
const callOpts: RunCallOpts = {
to: toAddress,
caller: this._evmAccountIfExists,
origin: this._evmAccountIfExists,
data: encodedDataBytes,
});
};
const result = await this._evmIfExists.runCall(callOpts);
rawCallResult = `0x${result.execResult.returnValue.toString('hex')}`;
} catch (err) {
BaseContract._throwIfThrownErrorIsRevertError(err);
Expand Down
2 changes: 1 addition & 1 deletion contracts-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@0x/utils": "^6.5.3",
"@types/node": "12.12.54",
"ethereum-types": "^3.7.0",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"mkdirp": "^0.5.1",
"prettier": "^1.16.3",
"to-snake-case": "^1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"ethereum-types": "^3.7.0",
"lodash": "^4.17.11",
"web3-provider-engine": "14.0.6"
"lodash": "^4.17.21",
"web3-provider-engine": "16.0.4"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion monorepo-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"es6-promisify": "^5.0.0",
"glob": "^7.1.2",
"isomorphic-fetch": "2.2.1",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"mkdirp": "^0.5.1",
"moment": "2.21.0",
"promisify-child-process": "^1.0.5",
Expand Down
4 changes: 2 additions & 2 deletions sol-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"typedoc": "~0.16.11",
"types-bn": "^0.0.1",
"typescript": "4.2.2",
"web3-provider-engine": "14.0.6",
"web3-provider-engine": "16.0.4",
"web3-typescript-typings": "^0.10.2",
"zeppelin-solidity": "1.8.0"
},
Expand All @@ -88,7 +88,7 @@
"chokidar": "^3.0.2",
"ethereum-types": "^3.7.0",
"ethereumjs-util": "^7.1.0",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"mkdirp": "^0.5.1",
"pluralize": "^7.0.0",
"require-from-string": "^2.0.1",
Expand Down
4 changes: 2 additions & 2 deletions sol-coverage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"@types/minimatch": "^3.0.3",
"@types/node": "12.12.54",
"ethereum-types": "^3.7.0",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"minimatch": "^3.0.4",
"web3-provider-engine": "14.0.6"
"web3-provider-engine": "16.0.4"
},
"devDependencies": {
"@0x/ts-doc-gen": "^0.0.28",
Expand Down
2 changes: 1 addition & 1 deletion sol-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^3.0.0",
"dirty-chai": "^2.0.1",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"make-promises-safe": "^1.1.0",
"mocha": "^6.2.0",
"shx": "^0.2.2",
Expand Down
4 changes: 2 additions & 2 deletions sol-profiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@types/node": "12.12.54",
"ethereum-types": "^3.7.0",
"ethereumjs-util": "^7.1.0",
"lodash": "^4.17.11",
"web3-provider-engine": "14.0.6"
"lodash": "^4.17.21",
"web3-provider-engine": "16.0.4"
},
"devDependencies": {
"@0x/ts-doc-gen": "^0.0.28",
Expand Down
2 changes: 1 addition & 1 deletion sol-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@0x/types": "^3.3.6",
"@0x/typescript-typings": "^5.3.1",
"@types/node": "12.12.54",
"lodash": "^4.17.11"
"lodash": "^4.17.21"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions sol-trace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"chalk": "^2.3.0",
"ethereum-types": "^3.7.0",
"ethereumjs-util": "^7.1.0",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"loglevel": "^1.6.1",
"web3-provider-engine": "14.0.6"
"web3-provider-engine": "16.0.4"
},
"devDependencies": {
"@0x/ts-doc-gen": "^0.0.28",
Expand Down
2 changes: 1 addition & 1 deletion sol-tracing-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"ethers": "~4.0.4",
"glob": "^7.1.2",
"istanbul": "^0.4.5",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"loglevel": "^1.6.1",
"mkdirp": "^0.5.1",
"rimraf": "^2.6.2",
Expand Down
9 changes: 9 additions & 0 deletions subproviders/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "7.0.0",
"changes": [
{
"note": "Update Ganache to 7.x",
"pr": 64
}
]
},
{
"timestamp": 1647415391,
"version": "6.6.5",
Expand Down
12 changes: 5 additions & 7 deletions subproviders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build": "tsc -b",
"build:ci": "yarn build",
"clean": "shx rm -rf lib generated_docs",
"watch": "tsc -b -w",
"lint": "tslint --format stylish --project .",
"fix": "tslint --fix --format stylish --project .",
"run_mocha_unit": "mocha --require source-map-support/register --require make-promises-safe lib/test/unit/**/*_test.js --timeout 10000 --bail --exit",
Expand All @@ -31,7 +32,7 @@
"s3:sync_md_docs": "aws s3 sync ./docs s3://docs-markdown/${npm_package_name}/v${npm_package_version} --profile 0xproject --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
"docs:md": "ts-doc-gen --sourceDir='$PROJECT_FILES' --output=$MD_FILE_DIR --fileExtension=mdx --tsconfig=./typedoc-tsconfig.json",
"docs:json": "typedoc --excludePrivate --excludeExternals --excludeProtected --ignoreCompilerErrors --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES",
"postinstall": "node -e \"try{ fs.unlinkSync(path.resolve(path.dirname(require.resolve('ganache-core')), './typings/index.d.ts')) } catch (err) {}\""
"postinstall": ""
},
"config": {
"postpublish": {
Expand All @@ -55,12 +56,12 @@
"bn.js": "^4.11.8",
"ethereum-types": "^3.7.0",
"ethereumjs-util": "^7.1.0",
"ganache-core": "^2.13.2",
"ganache": "^7.3.2",
"hdkey": "^0.7.1",
"json-rpc-error": "2.0.0",
"lodash": "^4.17.11",
"lodash": "^4.17.21",
"semaphore-async-await": "^1.5.1",
"web3-provider-engine": "14.0.6"
"web3-provider-engine": "16.0.4"
},
"devDependencies": {
"@0x/ts-doc-gen": "^0.0.28",
Expand Down Expand Up @@ -92,8 +93,5 @@
"publishConfig": {
"access": "public"
},
"browser": {
"ganache-core": false
},
"gitHead": "4f91bfd907996b2f4dd383778b50c479c2602b56"
}
Loading

0 comments on commit 27955e3

Please sign in to comment.