2019-07-12 10:43:15 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"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 {
|
|
|
|
Put(interface{}) (cid.Cid, error)
|
|
|
|
Get(cid.Cid, interface{}) error
|
|
|
|
|
|
|
|
GetHead() cid.Cid
|
|
|
|
|
|
|
|
// Commit sets the new head of the actors state as long as the current
|
|
|
|
// state matches 'oldh'
|
|
|
|
Commit(oldh cid.Cid, newh cid.Cid) error
|
|
|
|
}
|
|
|
|
|
2019-07-12 16:40:58 +00:00
|
|
|
type StateTree interface {
|
|
|
|
SetActor(addr address.Address, act *Actor) error
|
|
|
|
GetActor(addr address.Address) (*Actor, error)
|
|
|
|
}
|
|
|
|
|
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-12 20:56:41 +00:00
|
|
|
Send(to address.Address, method uint64, value BigInt, params []byte) ([]byte, uint8, error)
|
2019-07-12 10:43:15 +00:00
|
|
|
BlockHeight() uint64
|
|
|
|
GasUsed() BigInt
|
2019-07-12 03:59:55 +00:00
|
|
|
Storage() Storage
|
2019-07-12 16:40:58 +00:00
|
|
|
StateTree() (StateTree, error)
|
2019-07-12 10:43:15 +00:00
|
|
|
}
|