2019-07-12 10:43:15 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
2022-06-15 10:06:22 +00:00
|
|
|
"github.com/ipfs/go-cid"
|
2019-09-10 19:58:45 +00:00
|
|
|
cbg "github.com/whyrusleeping/cbor-gen"
|
2022-06-14 15:00:51 +00:00
|
|
|
|
|
|
|
"github.com/filecoin-project/go-address"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/lotus/chain/actors/aerrors"
|
2019-07-12 10:43:15 +00:00
|
|
|
)
|
|
|
|
|
2019-07-12 03:59:55 +00:00
|
|
|
type Storage interface {
|
2019-09-10 19:58:45 +00:00
|
|
|
Put(cbg.CBORMarshaler) (cid.Cid, aerrors.ActorError)
|
|
|
|
Get(cid.Cid, cbg.CBORUnmarshaler) aerrors.ActorError
|
2019-07-12 03:59:55 +00:00
|
|
|
|
|
|
|
GetHead() cid.Cid
|
|
|
|
|
|
|
|
// Commit sets the new head of the actors state as long as the current
|
|
|
|
// state matches 'oldh'
|
2019-07-22 16:08:54 +00:00
|
|
|
Commit(oldh cid.Cid, newh cid.Cid) aerrors.ActorError
|
2019-07-12 03:59:55 +00:00
|
|
|
}
|
|
|
|
|
2019-07-12 16:40:58 +00:00
|
|
|
type StateTree interface {
|
2019-07-22 18:17:42 +00:00
|
|
|
SetActor(addr address.Address, act *Actor) error
|
2020-02-18 18:10:42 +00:00
|
|
|
// GetActor returns the actor from any type of `addr` provided.
|
2019-07-22 18:17:42 +00:00
|
|
|
GetActor(addr address.Address) (*Actor, error)
|
2023-01-13 19:11:13 +00:00
|
|
|
|
|
|
|
Version() StateTreeVersion
|
2019-07-12 16:40:58 +00:00
|
|
|
}
|