mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-22 09:47:13 +01:00
add erc20 to integration test
This commit is contained in:
parent
7a184d67d2
commit
c7f0ca9dfa
@ -11,4 +11,4 @@ install:
|
|||||||
script:
|
script:
|
||||||
- npm run test
|
- npm run test
|
||||||
- npm run eslint
|
- npm run eslint
|
||||||
- ./cli.js auto
|
- ./cli.js test
|
||||||
|
8
cli.js
8
cli.js
@ -320,12 +320,16 @@ if (inBrowser) {
|
|||||||
else
|
else
|
||||||
printHelp(1)
|
printHelp(1)
|
||||||
break
|
break
|
||||||
case 'auto':
|
case 'test':
|
||||||
if (args.length === 1) {
|
if (args.length === 1) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await init()
|
await init()
|
||||||
|
const account = (await web3.eth.getAccounts())[0]
|
||||||
const note = await deposit()
|
const note = await deposit()
|
||||||
await withdraw(note, (await web3.eth.getAccounts())[0])
|
await withdraw(note, account)
|
||||||
|
|
||||||
|
const note2 = await deposit()
|
||||||
|
await withdraw(note2, account, account)
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,6 @@ const path = require('path')
|
|||||||
const genContract = require('circomlib/src/mimcsponge_gencontract.js')
|
const genContract = require('circomlib/src/mimcsponge_gencontract.js')
|
||||||
const Artifactor = require('truffle-artifactor')
|
const Artifactor = require('truffle-artifactor')
|
||||||
|
|
||||||
const SEED = 'mimcsponge'
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = function(deployer) {
|
module.exports = function(deployer) {
|
||||||
return deployer.then( async () => {
|
return deployer.then( async () => {
|
||||||
const contractsDir = path.join(__dirname, '..', 'build/contracts')
|
const contractsDir = path.join(__dirname, '..', 'build/contracts')
|
||||||
@ -15,7 +12,7 @@ module.exports = function(deployer) {
|
|||||||
await artifactor.save({
|
await artifactor.save({
|
||||||
contractName,
|
contractName,
|
||||||
abi: genContract.abi,
|
abi: genContract.abi,
|
||||||
unlinked_binary: genContract.createCode(SEED, 220),
|
unlinked_binary: genContract.createCode('mimcsponge', 220),
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
const hasherContract = artifacts.require(contractName)
|
const hasherContract = artifacts.require(contractName)
|
||||||
await deployer.deploy(hasherContract)
|
await deployer.deploy(hasherContract)
|
||||||
|
Loading…
Reference in New Issue
Block a user