2020-09-08 20:50:25 +00:00
|
|
|
package chaos
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ipfs/go-cid"
|
|
|
|
"github.com/multiformats/go-multihash"
|
2022-06-14 15:00:51 +00:00
|
|
|
|
|
|
|
"github.com/filecoin-project/go-address"
|
2020-09-08 20:50:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ChaosActorCodeCID is the CID by which this kind of actor will be identified.
|
|
|
|
var ChaosActorCodeCID = func() cid.Cid {
|
|
|
|
builder := cid.V1Builder{Codec: cid.Raw, MhType: multihash.IDENTITY}
|
|
|
|
c, err := builder.Sum([]byte("fil/1/chaos"))
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return c
|
|
|
|
}()
|
|
|
|
|
|
|
|
// Address is the singleton address of this actor. Its value is 98
|
|
|
|
// (builtin.FirstNonSingletonActorId - 2), as 99 is reserved for the burnt funds
|
|
|
|
// singleton.
|
|
|
|
var Address = func() address.Address {
|
|
|
|
// the address before the burnt funds address (99)
|
|
|
|
addr, err := address.NewIDAddress(98)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return addr
|
|
|
|
}()
|