Closed vkomenda closed 5 years ago
Could you show me any code which uses truffle migration for any of our tests? So that I could understand what you're talking about.
@varasev, the code that uses the balance is in the PR that I referenced above: https://github.com/poanetwork/pos-test-setup/pull/10
I'm not sure I fully understand this; let's just make sure we don't add code to the contracts that is meant for tests only and would break (also in the economical sense) a production network.
@vkomenda Yes, I saw that, thanks. But I still don't understand the aim of this. Do you want to run truffle unit tests of the contracts that way?
If so, you could just add the next command into the package.json
in the pos-test-setup
repo:
cd pos-contracts && npm i && npm run test && cd ..
Any modifications of the chain spec related to integration tests will be done outside this repo.
@vkomenda @varasev @afck would it be possible to make the initial validator balance configurable when generating the chain spec? Also, my understanding is that we will be moving the tests from https://github.com/poanetwork/pos-test-setup to here, for maintainability reasons.
I think the decision was to keep the repositories separate. Making the initial balance configurable sounds like a good idea to me. :+1:
We agreed that the repos should be separate and the balances can be changed in the generated spec.json
by the scripts working in pos-test-setup
if necessary. make_spec.js
will also be used for production mode where the balances must be zero.
This allows to run a Truffle migration where Truffle charges migration fees to the validator account. I added funds to every validator account because tests can be run from the perspective of any of those.
If this solution is too simplistic, the initial balances could be passed as arguments to
make_spec.js
, either from the environment or from ajson
config file.