diff --git a/contracts/tests/Inherited_test.go b/contracts/tests/Inherited_test.go index 9c6764708b..45c472207b 100644 --- a/contracts/tests/Inherited_test.go +++ b/contracts/tests/Inherited_test.go @@ -25,7 +25,12 @@ func TestPriceFeed(t *testing.T) { glogger.Verbosity(log.LevelTrace) log.SetDefault(log.NewLogger(glogger)) + oldTIPXDCXCancellationFee := new(big.Int).Set(common.TIPXDCXCancellationFee) + defer func() { + common.TIPXDCXCancellationFee = oldTIPXDCXCancellationFee + }() common.TIPXDCXCancellationFee = big.NewInt(0) + // init genesis contractBackend := backends.NewXDCSimulatedBackend( types.GenesisAlloc{ diff --git a/contracts/trc21issuer/trc21issuer_test.go b/contracts/trc21issuer/trc21issuer_test.go index 42b750cb0f..6163582d96 100644 --- a/contracts/trc21issuer/trc21issuer_test.go +++ b/contracts/trc21issuer/trc21issuer_test.go @@ -23,16 +23,13 @@ var ( subKey, _ = crypto.HexToECDSA("5bb98c5f937d176aa399ea6e6541f4db8f8db5a4ee1a8b56fb8beb41f2d755e3") subAddr = crypto.PubkeyToAddress(subKey.PublicKey) //0x21292d56E2a8De3cC4672dB039AAA27f9190B1f6 - token = common.HexToAddress("0000000000000000000000000000000000000089") - - delay = big.NewInt(30 * 48) minApply = big.NewInt(0).Mul(big.NewInt(1000), big.NewInt(100000000000000000)) // 100 XDC ) func TestFeeTxWithTRC21Token(t *testing.T) { - oldTRC21GasPriceBefore := new(big.Int).Set(common.TIPTRC21Fee) + oldTRC21GasPriceBefore := new(big.Int).Set(common.TRC21GasPriceBefore) defer func() { - common.TIPTRC21Fee = oldTRC21GasPriceBefore + common.TRC21GasPriceBefore = oldTRC21GasPriceBefore }() common.TRC21GasPriceBefore = big.NewInt(1) @@ -54,7 +51,12 @@ func TestFeeTxWithTRC21Token(t *testing.T) { contractBackend.Commit() // set contract address to config + oldTRC21IssuerSMC := common.TRC21IssuerSMC + defer func() { + common.TRC21IssuerSMC = oldTRC21IssuerSMC + }() common.TRC21IssuerSMC = trc21IssuerAddr + cap := big.NewInt(0).Mul(big.NewInt(10000000), big.NewInt(10000000000000)) TRC21fee := big.NewInt(100) diff --git a/tests/vm_test.go b/tests/vm_test.go index 819b5742ff..1816d02d60 100644 --- a/tests/vm_test.go +++ b/tests/vm_test.go @@ -25,8 +25,11 @@ import ( ) func TestVM(t *testing.T) { + oldTIPXDCXCancellationFee := new(big.Int).Set(common.TIPXDCXCancellationFee) + defer func() { + common.TIPXDCXCancellationFee = oldTIPXDCXCancellationFee + }() common.TIPXDCXCancellationFee = big.NewInt(100000000) - t.Parallel() vmt := new(testMatcher) vmt.fails("^vmSystemOperationsTest.json/createNameRegistrator$", "fails without parallel execution")