2022-05-11 19:30:07 +00:00
|
|
|
package build
|
|
|
|
|
|
|
|
import (
|
2022-05-12 17:53:12 +00:00
|
|
|
"bytes"
|
|
|
|
|
2022-05-11 19:30:07 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/actors"
|
2022-05-12 17:53:12 +00:00
|
|
|
|
|
|
|
"github.com/BurntSushi/toml"
|
2022-05-11 19:30:07 +00:00
|
|
|
)
|
|
|
|
|
2022-05-16 18:09:09 +00:00
|
|
|
var BuiltinActorReleases map[actors.Version]Bundle
|
2022-05-11 19:30:07 +00:00
|
|
|
|
|
|
|
func init() {
|
2022-05-16 18:09:09 +00:00
|
|
|
BuiltinActorReleases = make(map[actors.Version]Bundle)
|
2022-05-12 17:53:12 +00:00
|
|
|
|
|
|
|
spec := BundleSpec{}
|
|
|
|
|
|
|
|
r := bytes.NewReader(BuiltinActorBundles)
|
|
|
|
_, err := toml.DecodeReader(r, &spec)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, b := range spec.Bundles {
|
2022-05-16 18:09:09 +00:00
|
|
|
BuiltinActorReleases[b.Version] = b
|
2022-05-11 19:30:07 +00:00
|
|
|
}
|
|
|
|
}
|