Skip to content

Commit

Permalink
testing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gluk64 committed Feb 12, 2020
1 parent 5f9a841 commit 6cbbd40
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ loadtest: confirm_action
integration-testkit: build-contracts
cargo run --bin testkit --release

itest: # contracts simple integration tests
@bin/prepare-test-contracts.sh
@cd contracts && yarn itest

utest: # contracts unit tests
@bin/prepare-test-contracts.sh
@cd contracts && yarn unit-test

integration-simple:
@cd js/tests && yarn && yarn simple

Expand Down
3 changes: 1 addition & 2 deletions contracts/.waffle.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"sourcesPath": "./contracts",
"targetPath": "./build",
"compiler": "dockerized-solc",
"docker-tag": "0.5.16"
"compiler": "native"
}
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"build": "waffle .waffle.json && waffle .waffle.config_flat.json",
"test": "waffle .waffle.json && mocha -r ts-node/register test/**/*.ts",
"itest": "waffle .waffle.json && mocha -r ts-node/register test/integration_ganache.ts",
"itest": "waffle .waffle.json && mocha -r ts-node/register test/unit_tests/**/*.js test/integration_ganache.ts",
"unit-test": "waffle .waffle.json && mocha test/unit_tests/**/*.js",
"deploy": "yarn build && ts-node scripts/testnet-deploy.ts --deploy --publish",
"deploy-test-no-build": "ts-node scripts/testnet-deploy.ts --deploy --test",
Expand Down
9 changes: 3 additions & 6 deletions contracts/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,18 @@ export async function postBlockCommit(
);
if (!revertCode) {

const beforeOnchainOps = await franklinDeployedContract.totalOnchainOps();

const commitReceipt = await tx.wait();
const commitEvents = commitReceipt.events;

const commitedEvent1 = commitEvents[0].args;

expect(commitedEvent1.blockNumber).equal(blockNumber);

const afterOnchainOps = await franklinDeployedContract.totalOnchainOps();
// FIXME: ganache? expect(afterOnchainOps - beforeOnchainOps).equal(onchainOperationsNumber);

expect((await franklinDeployedContract.blocks(blockNumber)).onchainOperations).equal(onchainOperationsNumber);
expect((await franklinDeployedContract.blocks(blockNumber)).priorityOperations).equal(priorityOperationsNumber);
//FIXME: expect((await franklinDeployedContract.blocks(blockNumber)).commitment).equal(commitment);

expect((await franklinDeployedContract.blocks(blockNumber)).commitment).equal(commitment);

expect((await franklinDeployedContract.blocks(blockNumber)).stateRoot).equal("0x" + newRoot);
expect((await franklinDeployedContract.blocks(blockNumber)).validator).equal(wallet.address);

Expand Down

0 comments on commit 6cbbd40

Please sign in to comment.