Add missing onPreCompile stage hook (#851)
parent
dc9d976c0d
commit
ca695f0223
@ -0,0 +1,13 @@ |
|||||||
|
// Testing hooks
|
||||||
|
const fn = (msg, config) => config.logger.log(msg); |
||||||
|
|
||||||
|
module.exports = { |
||||||
|
skipFiles: [], |
||||||
|
silent: process.env.SILENT ? true : false, |
||||||
|
istanbulReporter: ['json-summary', 'text'], |
||||||
|
onPreCompile: fn.bind(null, 'running onPreCompile'), |
||||||
|
onServerReady: fn.bind(null, 'running onServerReady'), |
||||||
|
onTestsComplete: fn.bind(null, 'running onTestsComplete'), |
||||||
|
onCompileComplete: fn.bind(null, 'running onCompileComplete'), |
||||||
|
onIstanbulComplete: fn.bind(null, 'running onIstanbulComplete') |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
pragma solidity >=0.8.0 <0.9.0; |
||||||
|
|
||||||
|
|
||||||
|
contract ContractA { |
||||||
|
uint x; |
||||||
|
constructor() public { |
||||||
|
} |
||||||
|
|
||||||
|
function sendFn() public { |
||||||
|
x = 5; |
||||||
|
} |
||||||
|
|
||||||
|
function callFn() public pure returns (uint){ |
||||||
|
uint y = 5; |
||||||
|
return y; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
require("@nomiclabs/hardhat-truffle5"); |
||||||
|
require(__dirname + "/../plugins/nomiclabs.plugin"); |
||||||
|
|
||||||
|
module.exports = { |
||||||
|
solidity: { |
||||||
|
version: "0.8.17" |
||||||
|
}, |
||||||
|
logger: process.env.SILENT ? { log: () => {} } : console, |
||||||
|
}; |
@ -0,0 +1,15 @@ |
|||||||
|
const ContractA = artifacts.require("ContractA"); |
||||||
|
|
||||||
|
contract("contracta", function(accounts) { |
||||||
|
let instance; |
||||||
|
|
||||||
|
before(async () => instance = await ContractA.new()) |
||||||
|
|
||||||
|
it('sends', async function(){ |
||||||
|
await instance.sendFn(); |
||||||
|
}); |
||||||
|
|
||||||
|
it('calls', async function(){ |
||||||
|
await instance.callFn(); |
||||||
|
}) |
||||||
|
}); |
@ -1,13 +1,5 @@ |
|||||||
// Testing hooks
|
|
||||||
const fn = (msg, config) => config.logger.log(msg); |
|
||||||
|
|
||||||
module.exports = { |
module.exports = { |
||||||
skipFiles: ['Migrations.sol'], |
skipFiles: [], |
||||||
silent: process.env.SILENT ? true : false, |
silent: process.env.SILENT ? true : false, |
||||||
istanbulReporter: ['json-summary', 'text'], |
istanbulReporter: ['json-summary', 'text'] |
||||||
onPreCompile: fn.bind(null, 'running onPreCompile'), |
|
||||||
onServerReady: fn.bind(null, 'running onServerReady'), |
|
||||||
onTestsComplete: fn.bind(null, 'running onTestsComplete'), |
|
||||||
onCompileComplete: fn.bind(null, 'running onCompileComplete'), |
|
||||||
onIstanbulComplete: fn.bind(null, 'running onIstanbulComplete') |
|
||||||
} |
} |
||||||
|
Loading…
Reference in new issue