mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
b6829f36fd
HF_ prefix makes zero sense to me. If it's "hardfork", then it's in the "Hardforks" section already. If it's "hotfix", then it made some sense back when it was HF_2712_FixSyscallFees, but now it's codenamed anyway. So we can drop it and have a cleaner config.
30 lines
825 B
Go
30 lines
825 B
Go
package config
|
|
|
|
//go:generate stringer -type=Hardfork -linecomment
|
|
|
|
// Hardfork represents the application hard-fork identifier.
|
|
type Hardfork byte
|
|
|
|
const (
|
|
// HFAspidochelone represents hard-fork introduced in #2469 (ported from
|
|
// https://github.com/neo-project/neo/pull/2712) and #2519 (ported from
|
|
// https://github.com/neo-project/neo/pull/2749).
|
|
HFAspidochelone Hardfork = 1 << iota // Aspidochelone
|
|
)
|
|
|
|
// hardforks holds a map of Hardfork string representation to its type.
|
|
var hardforks map[string]Hardfork
|
|
|
|
func init() {
|
|
hardforks = make(map[string]Hardfork)
|
|
for _, hf := range []Hardfork{HFAspidochelone} {
|
|
hardforks[hf.String()] = hf
|
|
}
|
|
}
|
|
|
|
// IsHardforkValid denotes whether the provided string represents a valid
|
|
// Hardfork name.
|
|
func IsHardforkValid(s string) bool {
|
|
_, ok := hardforks[s]
|
|
return ok
|
|
}
|