mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-24 19:24:35 +00:00
Merge pull request #3554 from nspcc-dev/add-echidna
This commit is contained in:
commit
8ea0bc6e58
4 changed files with 13 additions and 4 deletions
|
@ -43,6 +43,9 @@ const (
|
||||||
// different ApplicationLogs comparing to the C# node, but the node states
|
// different ApplicationLogs comparing to the C# node, but the node states
|
||||||
// match. See #3485 for details.
|
// match. See #3485 for details.
|
||||||
HFDomovoi // Domovoi
|
HFDomovoi // Domovoi
|
||||||
|
// HFEchidna represents hard-fork introduced in #3554 (ported from
|
||||||
|
// https://github.com/neo-project/neo/pull/3454).
|
||||||
|
HFEchidna // Echidna
|
||||||
// hfLast denotes the end of hardforks enum. Consider adding new hardforks
|
// hfLast denotes the end of hardforks enum. Consider adding new hardforks
|
||||||
// before hfLast.
|
// before hfLast.
|
||||||
hfLast
|
hfLast
|
||||||
|
|
|
@ -13,14 +13,16 @@ func _() {
|
||||||
_ = x[HFBasilisk-2]
|
_ = x[HFBasilisk-2]
|
||||||
_ = x[HFCockatrice-4]
|
_ = x[HFCockatrice-4]
|
||||||
_ = x[HFDomovoi-8]
|
_ = x[HFDomovoi-8]
|
||||||
_ = x[hfLast-16]
|
_ = x[HFEchidna-16]
|
||||||
|
_ = x[hfLast-32]
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
_Hardfork_name_0 = "DefaultAspidocheloneBasilisk"
|
_Hardfork_name_0 = "DefaultAspidocheloneBasilisk"
|
||||||
_Hardfork_name_1 = "Cockatrice"
|
_Hardfork_name_1 = "Cockatrice"
|
||||||
_Hardfork_name_2 = "Domovoi"
|
_Hardfork_name_2 = "Domovoi"
|
||||||
_Hardfork_name_3 = "hfLast"
|
_Hardfork_name_3 = "Echidna"
|
||||||
|
_Hardfork_name_4 = "hfLast"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -37,6 +39,8 @@ func (i Hardfork) String() string {
|
||||||
return _Hardfork_name_2
|
return _Hardfork_name_2
|
||||||
case i == 16:
|
case i == 16:
|
||||||
return _Hardfork_name_3
|
return _Hardfork_name_3
|
||||||
|
case i == 32:
|
||||||
|
return _Hardfork_name_4
|
||||||
default:
|
default:
|
||||||
return "Hardfork(" + strconv.FormatInt(int64(i), 10) + ")"
|
return "Hardfork(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,6 +371,7 @@ func TestNewBlockchain_InitHardforks(t *testing.T) {
|
||||||
config.HFBasilisk.String(): 0,
|
config.HFBasilisk.String(): 0,
|
||||||
config.HFCockatrice.String(): 0,
|
config.HFCockatrice.String(): 0,
|
||||||
config.HFDomovoi.String(): 0,
|
config.HFDomovoi.String(): 0,
|
||||||
|
config.HFEchidna.String(): 0,
|
||||||
}, bc.GetConfig().Hardforks)
|
}, bc.GetConfig().Hardforks)
|
||||||
})
|
})
|
||||||
t.Run("empty set", func(t *testing.T) {
|
t.Run("empty set", func(t *testing.T) {
|
||||||
|
@ -401,7 +402,7 @@ func TestNewBlockchain_InitHardforks(t *testing.T) {
|
||||||
})
|
})
|
||||||
t.Run("all present", func(t *testing.T) {
|
t.Run("all present", func(t *testing.T) {
|
||||||
bc := newTestChainWithCustomCfg(t, func(c *config.Config) {
|
bc := newTestChainWithCustomCfg(t, func(c *config.Config) {
|
||||||
c.ProtocolConfiguration.Hardforks = map[string]uint32{config.HFAspidochelone.String(): 5, config.HFBasilisk.String(): 10, config.HFCockatrice.String(): 15, config.HFDomovoi.String(): 20}
|
c.ProtocolConfiguration.Hardforks = map[string]uint32{config.HFAspidochelone.String(): 5, config.HFBasilisk.String(): 10, config.HFCockatrice.String(): 15, config.HFDomovoi.String(): 20, config.HFEchidna.String(): 25}
|
||||||
require.NoError(t, c.ProtocolConfiguration.Validate())
|
require.NoError(t, c.ProtocolConfiguration.Validate())
|
||||||
})
|
})
|
||||||
require.Equal(t, map[string]uint32{
|
require.Equal(t, map[string]uint32{
|
||||||
|
@ -409,6 +410,7 @@ func TestNewBlockchain_InitHardforks(t *testing.T) {
|
||||||
config.HFBasilisk.String(): 10,
|
config.HFBasilisk.String(): 10,
|
||||||
config.HFCockatrice.String(): 15,
|
config.HFCockatrice.String(): 15,
|
||||||
config.HFDomovoi.String(): 20,
|
config.HFDomovoi.String(): 20,
|
||||||
|
config.HFEchidna.String(): 25,
|
||||||
}, bc.GetConfig().Hardforks)
|
}, bc.GetConfig().Hardforks)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,7 +271,7 @@ func TestBlockchain_StartFromExistingDB(t *testing.T) {
|
||||||
|
|
||||||
_, _, _, err = chain.NewMultiWithCustomConfigAndStoreNoCheck(t, customConfig, cache)
|
_, _, _, err = chain.NewMultiWithCustomConfigAndStoreNoCheck(t, customConfig, cache)
|
||||||
require.Error(t, err)
|
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) {
|
t.Run("good", func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue