Skip to content

Commit

Permalink
config: enable Echidna for tests
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Khimov <[email protected]>
  • Loading branch information
roman-khimov committed Dec 24, 2024
1 parent dc747ce commit ab5128f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/protocol.unit_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ProtocolConfiguration:
Basilisk: 6
Cockatrice: 9
Domovoi: 12
Echidna: 13

ApplicationConfiguration:
SkipBlockVerification: false
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/blockchain_neotest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func TestBlockchain_StartFromExistingDB(t *testing.T) {

_, _, _, err = chain.NewMultiWithCustomConfigAndStoreNoCheck(t, customConfig, cache)
require.Error(t, err)
require.True(t, strings.Contains(err.Error(), fmt.Sprintf("native %s: version mismatch for the latest hardfork Domovoi (stored contract state differs from autogenerated one)", nativenames.CryptoLib)), err)
require.True(t, strings.Contains(err.Error(), fmt.Sprintf("native %s: version mismatch for the latest hardfork Echidna (stored contract state differs from autogenerated one)", nativenames.CryptoLib)), err)
})

t.Run("good", func(t *testing.T) {
Expand Down
7 changes: 7 additions & 0 deletions pkg/core/native/native_test/neo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,13 @@ func TestNEO_CalculateBonus(t *testing.T) {
accH := acc.Signers[0].ScriptHash()
rewardDistance := 10

// We have 11 blocks made by transactions above and we need block 13 to get Echidna.
// Otherwise this happens:
// logger.go:146: 2024-12-24T17:52:18.160+0300 WARN contract invocation failed {"tx": "603d1b0e29e7aaf50513689be9d5bb946c7f7fec8836f0e90897c825fb762c13", "block": 13, "error": "at instruction 120 (SYSCALL): System.Contract.CallNative failed: gas limit exceeded"}
for range 3 {
e.AddNewBlock(t)
}

t.Run("Zero", func(t *testing.T) {
initialGASBalance := e.Chain.GetUtilityTokenBalance(accH)
for range rewardDistance {
Expand Down
1 change: 1 addition & 0 deletions pkg/services/rpcsrv/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,7 @@ func TestClient_GetVersion_Hardforks(t *testing.T) {
config.HFBasilisk: 6,
config.HFCockatrice: 9,
config.HFDomovoi: 12,
config.HFEchidna: 13,
}
require.InDeltaMapValues(t, expected, v.Protocol.Hardforks, 0)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/rpcsrv/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const (
// not yet deployed to the testing basic chain.
invokescriptContractAVM = "VwIADBQBDAMOBQYMDQIODw0DDgcJAAAAAErZMCQE2zBwaEH4J+yMqiYEEUAMFA0PAwIJAAIBAwcDBAUCAQAOBgwJStkwJATbMHFpQfgn7IyqJgQSQBNA"
// block20StateRootLE is an LE stateroot of block #20 of basic testing chain.
block20StateRootLE = "570ba0814003f6e6a2a2e41d1b727f8af756e9c26d2453c8316868607b66da0a"
block20StateRootLE = "310acac4fd692ab7a90dbd7fcf6feaf1ac33aabeedf6592c4ddd08ff1dac15de"
)

var (
Expand Down

0 comments on commit ab5128f

Please sign in to comment.