define StateTreeVersion5 for NetworkVersion18

This commit is contained in:
vyzo 2022-11-09 08:30:42 +02:00
parent 5cb1e8a5d6
commit 1aadbf16ba
2 changed files with 7 additions and 9 deletions

View File

@ -152,16 +152,12 @@ func VersionForNetwork(ver network.Version) (types.StateTreeVersion, error) {
case network.Version12: case network.Version12:
return types.StateTreeVersion3, nil return types.StateTreeVersion3, nil
/* inline-gen template case network.Version13, network.Version14, network.Version15, network.Version16, network.Version17:
{{$lastNv := .latestNetworkVersion}}
case{{range .networkVersions}} {{if (ge . 13.)}} network.Version{{.}}{{if (lt . $lastNv)}},{{end}}{{end}}{{end}}:
/* inline-gen start */
case network.Version13, network.Version14, network.Version15, network.Version16, network.Version17, network.Version18:
/* inline-gen end */
return types.StateTreeVersion4, nil return types.StateTreeVersion4, nil
case network.Version18:
return types.StateTreeVersion5, nil
default: default:
panic(fmt.Sprintf("unsupported network version %d", ver)) panic(fmt.Sprintf("unsupported network version %d", ver))
} }

View File

@ -17,6 +17,8 @@ const (
StateTreeVersion3 StateTreeVersion3
// StateTreeVersion4 corresponds to actors v5 and above. // StateTreeVersion4 corresponds to actors v5 and above.
StateTreeVersion4 StateTreeVersion4
// StateTreeVersion5 corresponds to actors v10 and above.
StateTreeVersion5
) )
type StateRoot struct { type StateRoot struct {