Logo
Explore Help
Sign In
logos-storage/nim-ethers
1
0
Fork 0
You've already forked nim-ethers
mirror of https://github.com/logos-storage/nim-ethers.git synced 2026-01-02 21:53:08 +00:00
Code Issues Packages Projects Releases Wiki Activity
nim-ethers/testnode/contracts/TestHelpers.sol

11 lines
214 B
Solidity
Raw Normal View History

add revert helpers for testing Add the following helpers to help detect transaction reverts: 1. `reverts` 2. `revertsWith` 3. `doesNotRevert` 4. `doesNotRevertWith`
2022-09-15 20:38:25 +10:00
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract TestHelpers {
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
function doRevert(string calldata reason) public pure {
// Revert every tx with given reason
require(false, reason);
add revert helpers for testing Add the following helpers to help detect transaction reverts: 1. `reverts` 2. `revertsWith` 3. `doesNotRevert` 4. `doesNotRevertWith`
2022-09-15 20:38:25 +10:00
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.0 Page: 46ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API