mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-06 08:15:41 -04:00
eslinter WIP
This commit is contained in:
parent
f3b1b7f96e
commit
2b2e174d06
6 changed files with 817 additions and 90 deletions
|
@ -1,38 +1,39 @@
|
|||
function send(method, params = []) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line no-undef
|
||||
web3.currentProvider.send({
|
||||
jsonrpc: '2.0',
|
||||
id: Date.now(),
|
||||
method,
|
||||
params
|
||||
}, (err, res) => {
|
||||
return err ? reject(err) : resolve(res);
|
||||
});
|
||||
});
|
||||
return err ? reject(err) : resolve(res)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const takeSnapshot = async seconds => {
|
||||
return await send('evm_snapshot');
|
||||
const takeSnapshot = async () => {
|
||||
return await send('evm_snapshot')
|
||||
}
|
||||
|
||||
const revertSnapshot = async (id) => {
|
||||
await send('evm_revert', [id]);
|
||||
await send('evm_revert', [id])
|
||||
}
|
||||
|
||||
const mineBlock = async (timestamp) => {
|
||||
await send('evm_mine', [timestamp]);
|
||||
await send('evm_mine', [timestamp])
|
||||
}
|
||||
|
||||
const increaseTime = async (seconds) => {
|
||||
await send('evm_increaseTime', [seconds]);
|
||||
await send('evm_increaseTime', [seconds])
|
||||
}
|
||||
|
||||
const minerStop = async () => {
|
||||
await send('miner_stop', []);
|
||||
await send('miner_stop', [])
|
||||
}
|
||||
|
||||
const minerStart = async () => {
|
||||
await send('miner_start', []);
|
||||
await send('miner_start', [])
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
@ -42,4 +43,4 @@ module.exports = {
|
|||
minerStop,
|
||||
minerStart,
|
||||
increaseTime,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue