Add defer cleanup for global variables and remove t.Parallel() where
global state is modified to prevent race conditions and test pollution.
Changes:
1. tests/vm_test.go:
- Add defer to restore common.TIPXDCXCancellationFee
- Remove t.Parallel() since modifying global variable makes concurrent
execution unsafe, even with defer cleanup
- Prevents potential race conditions with other tests in the package
2. contracts/tests/Inherited_test.go:
- Add defer to restore common.TIPXDCXCancellationFee
- No t.Parallel() present, so safe with defer alone
3. contracts/trc21issuer/trc21issuer_test.go:
- Add defer to restore common.TRC21IssuerSMC (was missing)
- Fix existing bug: restore correct variable common.TRC21GasPriceBefore
instead of common.TIPTRC21Fee
- Remove unused variables: token, delay
Rationale for removing t.Parallel():
While defer ensures cleanup after test completion, during test execution
the modified global variable is visible to all concurrent tests. Even
though tests/vm_test.go is currently the only test modifying
TIPXDCXCancellationFee, removing t.Parallel() is the safer approach to
ensure complete test isolation and prevent timing-dependent behavior.
This follows the same principles as the txpool MinGasPrice fix: global
variable modifications should not occur during concurrent test execution.
Implement https://github.com/ethereum/go-ethereum/issues/32078
Parse and lookup the delegation account if EIP7702 is enabled.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
* Detect non-EVM special transactions and construct a synthetic top level callFrame in OnTxStart.
* GetResult returns the virtual frame for non-EVM txs to preserve debug API compatibility.
* Add bounds checks in OnTxEnd and OnLog to avoid panics when callstack is empty.
* Add unit tests to verify the fix
* feat: GetTokenSupply API, total minted and burned
* feat: token supply API finish burned token. rename minted record functions
* fix(api): handle edge case about minus 1 for epoch in token supply
* fix: check both total minted and burned before breaking loop
* style: modify minor style
* style: modify by comment and rebase code
* chore: modify test based on statedb_utils