Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sasurobert committed Apr 25, 2024
1 parent 183514b commit 5894e09
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/multiversx/mx-chain-scenario-go v1.4.3-0.20240212160120-cc32d1580157
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240321150623-3974ec1d6474
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240424111748-6dfa8aa14813
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240424110355-a970819f5a9d
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240424134454-27f4efb28f47
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.66-0.20240424112443-1a66307bc44e
github.com/multiversx/mx-chain-vm-v1_3-go v1.3.67-0.20240424112610-ab7b9e5829bd
github.com/multiversx/mx-chain-vm-v1_4-go v1.4.96-0.20240424113019-3a7d2b215137
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240321150623-3974ec1d6474
github.com/multiversx/mx-chain-storage-go v1.0.15-0.20240321150623-3974ec1d6474/go.mod h1:hnc6H4D5Ge1haRAQ6QHTXhyh+CT2DRiNJ0U0HQYI3DY=
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240424111748-6dfa8aa14813 h1:pjknvxvRG1fQ6Dc0ZjFkWBwDLfPn2DbtACIwTBwYIA8=
github.com/multiversx/mx-chain-vm-common-go v1.5.12-0.20240424111748-6dfa8aa14813/go.mod h1:G6daPJC6bFsvAw45RPMCRi2rP+8LjFxa8G+3alHuJow=
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240424110355-a970819f5a9d h1:8CCcWHUKVVTRrePUhstggVCs+cEAkKTEX55R19Pz+lM=
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240424110355-a970819f5a9d/go.mod h1:DyMusfHXRXyVYQmH2umBTZD5gm6p136EJNC6YI2l+kU=
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240424134454-27f4efb28f47 h1:RGW/1czsPJtU10ojsOGWMpWLWENbbL6ruJ7kUZkT0Zo=
github.com/multiversx/mx-chain-vm-go v1.5.28-0.20240424134454-27f4efb28f47/go.mod h1:DyMusfHXRXyVYQmH2umBTZD5gm6p136EJNC6YI2l+kU=
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.66-0.20240424112443-1a66307bc44e h1:Yg5Bx9iuMBpe+MTbL+VTdINlQeqjqDFIAOE4A8sWamc=
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.66-0.20240424112443-1a66307bc44e/go.mod h1:0hoqSWVXkNvg0iYWDpYQcLyCBwz0DPIrTVf3kAtXHwU=
github.com/multiversx/mx-chain-vm-v1_3-go v1.3.67-0.20240424112610-ab7b9e5829bd h1:uM2FFSLvdWT7V8xRCaP01roTINT3rfTXAaiWQ1yFhag=
Expand Down
2 changes: 2 additions & 0 deletions integrationTests/multiShard/smartContract/scCallingSC_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ func TestSCCallingInCrossShardDelegation(t *testing.T) {
require.True(t, bytes.Contains(vmOutputVersion.ReturnData[0], []byte("0.3.")))
log.Info("SC deployed", "version", string(vmOutputVersion.ReturnData[0]))

logger.SetLogLevel("process/smartcontract:TRACE")

Check failure on line 778 in integrationTests/multiShard/smartContract/scCallingSC_test.go

View workflow job for this annotation

GitHub Actions / golangci linter

Error return value of `logger.SetLogLevel` is not checked (errcheck)
nonce, round = integrationTests.WaitOperationToBeDone(t, nodes, 1, nonce, round, idxProposers)

// set stake per node
Expand Down Expand Up @@ -850,6 +851,7 @@ func TestSCCallingInCrossShardDelegation(t *testing.T) {
FuncName: "getUserActiveStake",
Arguments: [][]byte{delegateSCOwner},
}

vmOutput4, _, _ := shardNode.SCQueryService.ExecuteQuery(scQuery4)
require.NotNil(t, vmOutput4)
require.Equal(t, len(vmOutput4.ReturnData), 1)
Expand Down
12 changes: 6 additions & 6 deletions integrationTests/vm/txsFee/apiTransactionEvaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package txsFee

import (
"encoding/hex"
"fmt"
"math/big"
"testing"

Expand Down Expand Up @@ -30,26 +31,25 @@ func TestSCCallCostTransactionCost(t *testing.T) {
t.Skip("this is not a short test")
}

testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{
DynamicGasCostForDataTrieStorageLoadEnableEpoch: integrationTests.UnreachableEpoch,
})
testContext, err := vm.CreatePreparedTxProcessorWithVMs(config.EnableEpochs{})
require.Nil(t, err)
defer testContext.Close()

scAddress, _ := utils.DoDeployNoChecks(t, testContext, "../wasm/testdata/counter/output/counter.wasm")
utils.CleanAccumulatedIntermediateTransactions(t, testContext)

sndAddr := []byte("12345678901234567890123456789112")
senderBalance := big.NewInt(100000)
gasLimit := uint64(1000)
senderBalance := big.NewInt(100000000000)
gasLimit := uint64(10000000)

_, _ = vm.CreateAccount(testContext.Accounts, sndAddr, 0, senderBalance)

tx := vm.CreateTransaction(0, big.NewInt(0), sndAddr, scAddress, gasPrice, gasLimit, []byte("increment"))

res, err := testContext.TxCostHandler.ComputeTransactionGasLimit(tx)
require.Nil(t, err)
require.Equal(t, uint64(418), res.GasUnits)
fmt.Println(res.GasUnits)
require.Equal(t, uint64(15704), res.GasUnits)
}

func TestScDeployTransactionCost(t *testing.T) {
Expand Down

0 comments on commit 5894e09

Please sign in to comment.