2020-09-24 00:01:40 +00:00
|
|
|
package actors
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/go-state-types/network"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Version int
|
|
|
|
|
|
|
|
const (
|
2020-10-07 00:51:43 +00:00
|
|
|
Version0 Version = 0
|
|
|
|
Version2 Version = 2
|
2020-09-24 00:01:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Converts a network version into an actors adt version.
|
|
|
|
func VersionForNetwork(version network.Version) Version {
|
|
|
|
switch version {
|
2020-09-28 19:53:40 +00:00
|
|
|
case network.Version0, network.Version1, network.Version2, network.Version3:
|
2020-09-24 00:01:40 +00:00
|
|
|
return Version0
|
2020-10-12 05:31:46 +00:00
|
|
|
case network.Version4, network.Version5:
|
2020-09-28 23:14:51 +00:00
|
|
|
return Version2
|
2020-09-24 00:01:40 +00:00
|
|
|
default:
|
|
|
|
panic(fmt.Sprintf("unsupported network version %d", version))
|
|
|
|
}
|
|
|
|
}
|