2019-07-12 10:43:15 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
2019-07-22 16:08:54 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/chain/actors/aerrors"
|
2019-07-12 10:43:15 +00:00
|
|
|
"github.com/filecoin-project/go-lotus/chain/address"
|
2019-07-12 03:59:55 +00:00
|
|
|
"github.com/ipfs/go-cid"
|
2019-07-12 10:43:15 +00:00
|
|
|
"github.com/ipfs/go-hamt-ipld"
|
|
|
|
)
|
|
|
|
|
2019-07-12 03:59:55 +00:00
|
|
|
type Storage interface {
|
2019-07-22 16:08:54 +00:00
|
|
|
Put(interface{}) (cid.Cid, aerrors.ActorError)
|
|
|
|
Get(cid.Cid, interface{}) 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
|
|
|
|
GetActor(addr address.Address) (*Actor, error)
|
2019-07-12 16:40:58 +00:00
|
|
|
}
|
|
|
|
|
2019-07-12 10:43:15 +00:00
|
|
|
type VMContext interface {
|
|
|
|
Message() *Message
|
2019-07-16 16:40:25 +00:00
|
|
|
Origin() address.Address
|
2019-07-12 10:43:15 +00:00
|
|
|
Ipld() *hamt.CborIpldStore
|
2019-07-22 16:08:54 +00:00
|
|
|
Send(to address.Address, method uint64, value BigInt, params []byte) ([]byte, aerrors.ActorError)
|
2019-07-12 10:43:15 +00:00
|
|
|
BlockHeight() uint64
|
|
|
|
GasUsed() BigInt
|
2019-07-12 03:59:55 +00:00
|
|
|
Storage() Storage
|
2019-07-22 16:08:54 +00:00
|
|
|
StateTree() (StateTree, aerrors.ActorError)
|
2019-07-24 05:38:16 +00:00
|
|
|
VerifySignature(sig Signature, from address.Address) aerrors.ActorError
|
2019-07-12 10:43:15 +00:00
|
|
|
}
|