Skip to content

Commit

Permalink
Merge branch 'dev' into lyova-983-refactor-shell-scripts-and-makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed Nov 1, 2020
2 parents b69099f + c5f6ca3 commit 5934c69
Show file tree
Hide file tree
Showing 19 changed files with 2,329 additions and 3,686 deletions.
26 changes: 13 additions & 13 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@
"license": "MIT",
"devDependencies": {
"@types/argparse": "^1.0.36",
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.7",
"@types/chai": "^4.2.14",
"@types/mocha": "^8.0.3",
"argparse": "^1.0.10",
"axios": "^0.19.0",
"axios": "^0.21.0",
"chai": "^4.2.0",
"chalk": "^4.1.0",
"ethereum-waffle": "^3.0.0",
"ethereum-waffle": "^3.1.2",
"ethereumjs-abi": "^0.6.8",
"ethers": "^5.0.0",
"ethers": "^5.0.19",
"ethjs": "^0.4.0",
"fs": "^0.0.1-security",
"mocha": "^6.2.0",
"mocha": "^8.2.0",
"openzeppelin-solidity": "^2.3.0",
"path": "^0.12.7",
"prettier": "^1.18.2",
"prettier-plugin-solidity": "^1.0.0-alpha.27",
"prettier": "^2.1.2",
"prettier-plugin-solidity": "^1.0.0-alpha.59",
"querystring": "^0.2.0",
"solhint": "^2.1.2",
"solhint-plugin-prettier": "^0.0.3",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"typescript": "^3.5.3",
"solhint": "^3.3.1",
"solhint-plugin-prettier": "^0.0.5",
"ts-node": "^9.0.0",
"tslint": "^6.1.3",
"typescript": "^4.0.5",
"zksync": "link:../sdk/zksync.js"
},
"scripts": {
Expand Down
3,046 changes: 970 additions & 2,076 deletions contracts/yarn.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions core/bin/zksync_api/src/api_server/rpc_server/rpc_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use jsonrpc_core::{Error, Result};
use num::{bigint::ToBigInt, BigUint};
// Workspace uses
use zksync_types::{
helpers::closest_packable_fee_amount,
tx::{TxEthSignature, TxHash},
Address, Token, TokenLike, TxFeeTypes, ZkSyncTx,
};
Expand Down Expand Up @@ -392,6 +393,8 @@ impl RpcApp {
.await?
.total_fee;
}
// Sum of transactions can be unpackable
total_fee = closest_packable_fee_amount(&total_fee);

Ok(BatchFee { total_fee })
}
Expand Down
10 changes: 5 additions & 5 deletions core/tests/ts-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
"fmt": "prettier --write {tests,api-types}/*.ts"
},
"devDependencies": {
"@types/chai": "^4.2.13",
"@types/chai": "^4.2.14",
"@types/mocha": "^8.0.3",
"@types/mocha-steps": "^1.3.0",
"@types/node": "^14.11.5",
"@types/node": "^14.14.5",
"@types/node-fetch": "^2.5.7",
"chai": "^4.2.0",
"ethers": "^5.0.15",
"mocha": "^8.1.3",
"ethers": "^5.0.19",
"mocha": "^8.2.0",
"mocha-steps": "^1.3.0",
"node-fetch": "^2.6.1",
"prettier": "^2.1.2",
"ts-node": "^9.0.0",
"typescript": "^4.0.3",
"typescript": "^4.0.5",
"zksync": "link:../../../sdk/zksync.js"
}
}
49 changes: 42 additions & 7 deletions core/tests/ts-tests/tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,47 @@ describe(`ZkSync integration tests (token: ${token}, transport: ${transport})`,
});
});

const transports = process.env.TEST_TRANSPORT ? [process.env.TEST_TRANSPORT.toUpperCase()] : ['HTTP', 'WS'];
const tokens = process.env.TEST_TOKEN ? [process.env.TEST_TOKEN.toUpperCase()] : ['ETH', 'DAI'];

for (const transport of transports) {
for (const token of tokens) {
// @ts-ignore
TestSuite(token, transport);
// wBTC is chosen because it has decimals different from ETH (8 instead of 18).
// Using this token will help us to detect decimals-related errors.
const defaultERC20 = 'wBTC';

let tokenAndTransport = [];
if (process.env.TEST_TRANSPORT) {
if (process.env.TEST_TOKEN) {
// Both transport and token are set, use config from env.
const envTransport = process.env.TEST_TRANSPORT.toUpperCase();
const envToken = process.env.TEST_TOKEN.toUpperCase();
tokenAndTransport = [
{
transport: envTransport,
token: envToken
}
];
} else {
// Only transport is set, use wBTC as default token for this transport.
const envTransport = process.env.TEST_TRANSPORT.toUpperCase();
tokenAndTransport = [
{
transport: envTransport,
token: defaultERC20
}
];
}
} else {
// Default case: run HTTP&ETH / WS&wBTC.
tokenAndTransport = [
{
transport: 'HTTP',
token: 'ETH'
},
{
transport: 'WS',
token: defaultERC20
}
];
}

for (const input of tokenAndTransport) {
// @ts-ignore
TestSuite(input.token, input.transport);
}
Loading

0 comments on commit 5934c69

Please sign in to comment.