lotus/chain/actors/version.go
Steven Allen 87351fa35c move version to actors, from builtin
Otherwise, we're going to end up with an import cycle between the adt and this
version.
2020-09-25 12:49:39 -07:00

25 lines
437 B
Go

package actors
import (
"fmt"
"github.com/filecoin-project/go-state-types/network"
)
type Version int
const (
Version0 = iota
Version1
)
// Converts a network version into an actors adt version.
func VersionForNetwork(version network.Version) Version {
switch version {
case network.Version0, network.Version1, network.Version2:
return Version0
default:
panic(fmt.Sprintf("unsupported network version %d", version))
}
}