2019-07-12 23:52:25 +00:00
|
|
|
package actors
|
2019-07-05 14:29:17 +00:00
|
|
|
|
|
|
|
import (
|
2019-10-18 04:47:41 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/address"
|
2019-07-05 14:29:17 +00:00
|
|
|
|
|
|
|
"github.com/ipfs/go-cid"
|
|
|
|
mh "github.com/multiformats/go-multihash"
|
|
|
|
)
|
|
|
|
|
|
|
|
var AccountActorCodeCid cid.Cid
|
|
|
|
var StorageMarketActorCodeCid cid.Cid
|
|
|
|
var StorageMinerCodeCid cid.Cid
|
|
|
|
var MultisigActorCodeCid cid.Cid
|
|
|
|
var InitActorCodeCid cid.Cid
|
2019-08-09 21:41:50 +00:00
|
|
|
var PaymentChannelActorCodeCid cid.Cid
|
2019-07-05 14:29:17 +00:00
|
|
|
|
|
|
|
var InitActorAddress = mustIDAddress(0)
|
|
|
|
var NetworkAddress = mustIDAddress(1)
|
|
|
|
var StorageMarketAddress = mustIDAddress(2)
|
2019-09-12 04:12:35 +00:00
|
|
|
var BurntFundsAddress = mustIDAddress(99)
|
2019-07-05 14:29:17 +00:00
|
|
|
|
|
|
|
func mustIDAddress(i uint64) address.Address {
|
|
|
|
a, err := address.NewIDAddress(i)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
pref := cid.NewPrefixV1(cid.Raw, mh.ID)
|
|
|
|
mustSum := func(s string) cid.Cid {
|
|
|
|
c, err := pref.Sum([]byte(s))
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return c
|
|
|
|
}
|
|
|
|
|
|
|
|
AccountActorCodeCid = mustSum("account")
|
|
|
|
StorageMarketActorCodeCid = mustSum("smarket")
|
|
|
|
StorageMinerCodeCid = mustSum("sminer")
|
|
|
|
MultisigActorCodeCid = mustSum("multisig")
|
|
|
|
InitActorCodeCid = mustSum("init")
|
2019-08-09 21:41:50 +00:00
|
|
|
PaymentChannelActorCodeCid = mustSum("paych")
|
2019-07-05 14:29:17 +00:00
|
|
|
}
|