Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
evm_revert does not reset time adjustment #390
I'm trying to make my unit tests run faster by re-using setup transactions using snapshots.
I haven't been using it in the last few weeks so the setup may need a few tweaks but here's what I did to test it:
(*) I think there is a cleaner way to do this with
Creating a symbolic link or alias in your terminal to launch the custom testrpc may be a good idea if you're planning on using it frequently.
Edit: Satisfying the other dependencies in both packages is necessary for this to work and prone to errors in my limited experience using npm. Use whatever means you deem adequate to satisfy them.
patch node_modules/ethereumjs-testrpc/build/cli.node.js testrpc-time.patch
83416c83416,83417 < blockNumber: blockNumber --- > blockNumber: blockNumber, > timeAdjustment: self.blockchain.timeAdjustment 83438a83440 > var timeAdjustment = this.snapshots[snapshot_id].timeAdjustment; 83465a83468,83469 > // The time adjustment is restored to its prior state > self.blockchain.timeAdjustment = timeAdjustment;