Use more inline-gen
This commit is contained in:
parent
e493d9e2e3
commit
463f55ba13
@ -8,9 +8,21 @@ import (
|
||||
|
||||
type Version int
|
||||
|
||||
/* inline-gen template
|
||||
|
||||
var LatestVersion = 6
|
||||
|
||||
var Versions = []int{0, 2, 3, 4, 5, LatestVersion}
|
||||
var Versions = []int{ {{range .actorVersions}} {{.}}, {{end}} }
|
||||
|
||||
const ({{range .actorVersions}}
|
||||
Version{{.}} Version = {{.}}{{end}}
|
||||
)
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
var LatestVersion = 6
|
||||
|
||||
var Versions = []int{0, 2, 3, 4, 5, 6}
|
||||
|
||||
const (
|
||||
Version0 Version = 0
|
||||
@ -21,6 +33,8 @@ const (
|
||||
Version6 Version = 6
|
||||
)
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
// Converts a network version into an actors adt version.
|
||||
func VersionForNetwork(version network.Version) (Version, error) {
|
||||
switch version {
|
||||
|
@ -152,7 +152,16 @@ func VersionForNetwork(ver network.Version) (types.StateTreeVersion, error) {
|
||||
return types.StateTreeVersion2, nil
|
||||
case network.Version12:
|
||||
return types.StateTreeVersion3, nil
|
||||
|
||||
/* inline-gen template
|
||||
{{$lastNv := .latestNetworkVersion}}
|
||||
case{{range .networkVersions}} {{if (ge . 13.)}} network.Version{{.}}{{if (lt . $lastNv)}},{{end}}{{end}}{{end}}:
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
case network.Version13, network.Version14:
|
||||
|
||||
/* inline-gen end */
|
||||
return types.StateTreeVersion4, nil
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported network version %d", ver))
|
||||
|
@ -3,15 +3,11 @@
|
||||
- [ ] Import new actors
|
||||
- [ ] Define upgrade heights in `build/params_`
|
||||
- [ ] Generate adapters
|
||||
- [ ] Add the new version in `chain/actors/agen/main.go`
|
||||
- [ ] Update `gen/inlinegen-data.json`
|
||||
- [ ] Update adapter code in `chain/actors/version.go` if needed
|
||||
- [ ] Update adapter code in `chain/actors/builtin` if needed
|
||||
- [ ] Update `chain/actors/policy/policy.go`
|
||||
- [ ] Update `chain/actors/version.go`
|
||||
- [ ] Register in `chain/vm/invoker.go`
|
||||
- [ ] Update `chain/types/state.go`
|
||||
- [ ] Update `chain/state/statetree.go` (New / Load)
|
||||
- [ ] Update `chain/stmgr/forks.go`
|
||||
- [ ] Run `make actors-gen`
|
||||
- [ ] Update `chain/consensus/filcns/upgrades.go`
|
||||
- [ ] Schedule
|
||||
- [ ] Migration
|
||||
- [ ] Update upgrade schedule in `chain/sync_test.go`
|
||||
- [ ] Register in init in `chain/stmgr/utils.go`
|
||||
|
Loading…
Reference in New Issue
Block a user