diff --git a/pkg/compiler/native_test.go b/pkg/compiler/native_test.go index a3c6780e0..d3fe17e9b 100644 --- a/pkg/compiler/native_test.go +++ b/pkg/compiler/native_test.go @@ -310,7 +310,7 @@ func getMethod(t *testing.T, ctr interop.ContractMD, name string, params []strin name = strings.TrimSuffix(name, "WithData") } - latestHF := config.LatestHardfork() + latestHF := config.HFLatestKnown cMD := ctr.HFSpecificContractMD(&latestHF) md, ok := cMD.GetMethod(name, paramLen) require.True(t, ok, cMD.Manifest.Name, name, paramLen) diff --git a/pkg/config/hardfork.go b/pkg/config/hardfork.go index 675510989..6b946dde2 100644 --- a/pkg/config/hardfork.go +++ b/pkg/config/hardfork.go @@ -57,6 +57,9 @@ const ( // between releases even if the set of known hardforks is the same. const HFLatestStable = HFDomovoi +// HFLatestKnown is the latest known hardfork. +const HFLatestKnown = hfLast >> 1 + // StableHardforks is an ordered slice of all stable hardforks (before or // equal [HFLatestStable]). var StableHardforks []Hardfork @@ -110,8 +113,3 @@ func IsHardforkValid(s string) bool { _, ok := hardforks[s] return ok } - -// LatestHardfork returns latest known hardfork. -func LatestHardfork() Hardfork { - return hfLast >> 1 -} diff --git a/pkg/core/native/compatibility_test.go b/pkg/core/native/compatibility_test.go index d28c00bcd..9ed1074f4 100644 --- a/pkg/core/native/compatibility_test.go +++ b/pkg/core/native/compatibility_test.go @@ -12,7 +12,7 @@ import ( func TestNamesASCII(t *testing.T) { cfg := config.ProtocolConfiguration{P2PSigExtensions: true} cs := NewContracts(cfg) - latestHF := config.LatestHardfork() + latestHF := config.HFLatestKnown for _, c := range cs.Contracts { require.True(t, isASCII(c.Metadata().Name)) hfMD := c.Metadata().HFSpecificContractMD(&latestHF) diff --git a/pkg/core/native/contract_test.go b/pkg/core/native/contract_test.go index bda672689..c12cf25f9 100644 --- a/pkg/core/native/contract_test.go +++ b/pkg/core/native/contract_test.go @@ -12,7 +12,7 @@ import ( func TestNativeGetMethod(t *testing.T) { cfg := config.ProtocolConfiguration{P2PSigExtensions: true} cs := NewContracts(cfg) - latestHF := config.LatestHardfork() + latestHF := config.HFLatestKnown for _, c := range cs.Contracts { hfMD := c.Metadata().HFSpecificContractMD(&latestHF) t.Run(c.Metadata().Name, func(t *testing.T) {