Skip to content

Commit

Permalink
fix migrate code leaf flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ssd04 committed Jan 23, 2024
1 parent bec3579 commit bac3dac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
WithoutCodeLeafString = "without code leaf"

autoBalanceDataTriesFlag = EnableEpochFlag("AutoBalanceDataTriesFlag")
withoutCodeLeafFlag = EnableEpochFlag("RemoveCodeLeafFlag")
migrateCodeLeafFlag = EnableEpochFlag("MigrateCodeLeafFlag")
)

func (version TrieNodeVersion) String() string {
Expand Down Expand Up @@ -69,7 +69,7 @@ func NewTrieNodeVersionVerifier(enableEpochsHandler EnableEpochsHandler) (*trieN

// IsValidVersion returns true if the given trie node version is valid
func (vv *trieNodeVersionVerifier) IsValidVersion(version TrieNodeVersion) bool {
if vv.enableEpochsHandler.IsFlagEnabled(withoutCodeLeafFlag) {
if vv.enableEpochsHandler.IsFlagEnabled(migrateCodeLeafFlag) {
return version <= WithoutCodeLeaf
}
if vv.enableEpochsHandler.IsFlagEnabled(autoBalanceDataTriesFlag) {
Expand All @@ -86,7 +86,7 @@ func (vv *trieNodeVersionVerifier) IsInterfaceNil() bool {

// GetVersionForNewData returns the trie node version that should be used for new data
func GetVersionForNewData(handler EnableEpochsHandler) TrieNodeVersion {
if handler.IsFlagEnabled(withoutCodeLeafFlag) {
if handler.IsFlagEnabled(migrateCodeLeafFlag) {
return WithoutCodeLeaf
}
if handler.IsFlagEnabled(autoBalanceDataTriesFlag) {
Expand Down

0 comments on commit bac3dac

Please sign in to comment.