nim-ethers/testnode/contracts/TestHelpers.sol
Eric 7eac8410af
prevent stuck transactions by async locking nonce sequencing (+ estimate gas) (#55)
- async lock during nonce sequencing + gas estimation
- simplified cancelTransaction (still exported) such that the new transaction is populated using populateTransaction, so that all gas and fees are reset
- moved reverting contract function into its own testing helpers module, and refactored any tests to use it
- updated the test helper reverts to check EstimateGasErrors
- combine ensureNonceSequence into populateTransaction
2023-10-25 10:42:25 +11:00

11 lines
214 B
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract TestHelpers {
function doRevert(string calldata reason) public pure {
// Revert every tx with given reason
require(false, reason);
}
}