Generate Hasher artifact upon compile, not migrate

To fix intermittent `truffle test` failures, use Truffle's external
compiler system for generating a valid artifact for Hasher at
compile-time instead of in migrations/2_deploy_hasher.js.

- Define compileHelper.js script, which outputs temporary artifact
  data to `./build/Hasher.json`.

- Configure `external` compiler in truffle-config to run compileHelper
  and process result

- Remove usage of @truffle/artifactor in migration, since the artifact
  will now already exist
This commit is contained in:
g. nicholas d'andrea 2020-04-29 01:13:42 -04:00
parent a533ad9ffb
commit 7ceebf48d5
5 changed files with 30 additions and 39 deletions

View file

@ -95,6 +95,12 @@ module.exports = {
},
// evmVersion: "byzantium"
}
},
external: {
command: 'node ./compileHasher.js',
targets: [{
path: './build/Hasher.json'
}]
}
}
}