Skip to content

Commit

Permalink
Use internal visibility for fn level hash method defs (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke authored Aug 28, 2021
1 parent 4c2410d commit 022d7d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Injector {
_getHashMethodDefinition(id, contract){
const hash = web3Utils.keccak256(id).slice(0,10);
const method = this._getMethodIdentifier(id);
return `\nfunction ${method}(bytes32 c__${hash}) public pure {}\n`;
return `\nfunction ${method}(bytes32 c__${hash}) internal pure {}\n`;
}

/**
Expand Down
19 changes: 0 additions & 19 deletions scripts/run-nomiclabs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,6 @@ fi

echo "PR_PATH >>>>> $PR_PATH"

echo ""
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "Simple buidler/buidler-trufflev5 "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo ""

# Install buidler-e2e
git clone https://github.com/sc-forks/buidler-e2e.git
cd buidler-e2e
npm install --silent

# Install and run solidity-coverage @ PR
npm install --save-dev --silent $PR_PATH
cat package.json

npx buidler coverage

verifyCoverageExists

echo ""
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "Simple hardhat/hardhat-trufflev5 "
Expand Down
12 changes: 6 additions & 6 deletions test/units/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ describe('asserts and requires', () => {
const mapping = coverage.generate(contract.data, util.pathPrefix);

assert.deepEqual(mapping[util.filePath].l, {
5: 1,
5: 2,
});
assert.deepEqual(mapping[util.filePath].b, {});
assert.deepEqual(mapping[util.filePath].s, {
1: 1,
1: 2,
});
assert.deepEqual(mapping[util.filePath].f, {
1: 1,
1: 2,
});
});

Expand All @@ -47,14 +47,14 @@ describe('asserts and requires', () => {

const mapping = coverage.generate(contract.data, util.pathPrefix);
assert.deepEqual(mapping[util.filePath].l, {
5: 2,
5: 4,
});
assert.deepEqual(mapping[util.filePath].b, {});
assert.deepEqual(mapping[util.filePath].s, {
1: 2,
1: 4,
});
assert.deepEqual(mapping[util.filePath].f, {
1: 2,
1: 4,
});
});

Expand Down
6 changes: 3 additions & 3 deletions test/units/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ describe('function declarations', () => {
const mapping = coverage.generate(contract.data, util.pathPrefix);

assert.deepEqual(mapping[util.filePath].l, {
6: 1, 11: 1
6: 2, 11: 1 // Doubled line-hit
});
assert.deepEqual(mapping[util.filePath].b, {});
assert.deepEqual(mapping[util.filePath].s, {
1: 1, 2: 1
1: 2, 2: 1
});
assert.deepEqual(mapping[util.filePath].f, {
1: 1,
1: 2,
2: 1,
});
});
Expand Down

0 comments on commit 022d7d8

Please sign in to comment.