-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2469 from nspcc-dev/hardfork
core: add ability to create hard-forks
- Loading branch information
Showing
12 changed files
with
172 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package config | ||
|
||
//go:generate stringer -type=Hardfork -linecomment | ||
|
||
// Hardfork represents the application hard-fork identifier. | ||
type Hardfork byte | ||
|
||
const ( | ||
// HF2712FixSyscallFees represents hard-fork introduced in #2469 (ported from | ||
// https://github.com/neo-project/neo/pull/2712) changing the prices of | ||
// System.Contract.CreateStandardAccount and | ||
// System.Contract.CreateMultisigAccount interops. | ||
HF2712FixSyscallFees Hardfork = 1 << iota // HF_2712_FixSyscallFees | ||
) | ||
|
||
// 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{HF2712FixSyscallFees} { | ||
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 | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters