Commit graph

7 commits

Author SHA1 Message Date
Daniel Liu
639531aae9
contracts, tests: fix global variable modifications and remove unsafe parallelism (#1882)
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.
2025-12-22 12:00:39 +05:30
wit liu
d6309612fc
all: fix unnecessary whitespace (#1800) 2025-12-08 15:07:11 +05:30
Daniel Liu
b6f3007af1 core: move genesis alloc types to core/types (#29003) 2025-01-24 16:54:12 +08:00
Daniel Liu
c1913bb22a accounts/abi/bind/backends: replace NewSimulatedBackend with NewXDCSimulatedBackend 2025-01-24 16:54:12 +08:00
Daniel Liu
eb90b2899f backends: increase gaslimit in order to allow tests of large contracts (#17358) 2025-01-24 16:18:28 +08:00
Daniel Liu
ec4ca1ed6a all: replace log15 with slog (#28187) 2024-11-15 10:02:42 +08:00
olumuyiwadad
b5abbfed79 new EVM Upgrade
- Solidity Upgraded up to v0.8.0
-  Fixed and Added eth_chainId
- Fix error in TransactionRecipet
- Reward halving issue fixed
2021-09-21 16:53:46 +05:30