mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-06 08:15:41 -04:00
add dummy test
This commit is contained in:
parent
5db6595c61
commit
641c76fa39
13 changed files with 5931 additions and 31 deletions
45
contracts/scripts/ganacheHelper.js
Normal file
45
contracts/scripts/ganacheHelper.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
function send(method, params = []) {
|
||||
return new Promise((resolve, reject) => {
|
||||
web3.currentProvider.send({
|
||||
jsonrpc: '2.0',
|
||||
id: Date.now(),
|
||||
method,
|
||||
params
|
||||
}, (err, res) => {
|
||||
return err ? reject(err) : resolve(res);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const takeSnapshot = async seconds => {
|
||||
return await send('evm_snapshot');
|
||||
}
|
||||
|
||||
const revertSnapshot = async (id) => {
|
||||
await send('evm_revert', [id]);
|
||||
}
|
||||
|
||||
const mineBlock = async (timestamp) => {
|
||||
await send('evm_mine', [timestamp]);
|
||||
}
|
||||
|
||||
const increaseTime = async (seconds) => {
|
||||
await send('evm_increaseTime', [seconds]);
|
||||
}
|
||||
|
||||
const minerStop = async () => {
|
||||
await send('miner_stop', []);
|
||||
}
|
||||
|
||||
const minerStart = async () => {
|
||||
await send('miner_start', []);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
takeSnapshot,
|
||||
revertSnapshot,
|
||||
mineBlock,
|
||||
minerStop,
|
||||
minerStart,
|
||||
increaseTime,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue