state

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor interface {
	Code() cid.Cid
	Head() cid.Cid
	Nonce() uint64
	Balance() types.BigInt
}

Actor is an abstraction over the actor states stored in the root of the state tree.

type PaymentChannelActorState

type PaymentChannelActorState interface {
	From() address.Address
	To() address.Address
	ToSend() types.BigInt
	ClosingAt() uint64
	MinCloseHeight() uint64
}

PaymentChannelActorState is an abstraction over a payment channel actor's state.

type Signer added in v0.0.5

type Signer interface {
	Sign(ctx context.Context, addr address.Address, data []byte) (*types.Signature, error)
}

type Storage

type Storage interface {
	Get(c cid.Cid, out interface{}) error
}

Storage provides a key/value store for actor state.

type Wrapper

type Wrapper interface {
	// Returns the CID of the root node of the state tree.
	Cid() cid.Cid

	// Returns the actor state at `address` (or an error if there is none).
	Actor(address address.Address) (Actor, error)

	// Returns the actor storage for the actor at `address` (which is empty if there is no such actor).
	Storage(address address.Address) (Storage, error)

	// Creates a new private key and returns the associated address.
	NewAccountAddress() (address.Address, error)

	// Sign data with addr's key.
	Sign(ctx context.Context, addr address.Address, data []byte) (*types.Signature, error)

	// Installs a new actor in the state tree.
	// This signature will probably become a little more complex when the actor state is non-empty.
	SetActor(address address.Address, code actors.ActorCodeID, balance types.BigInt) (Actor, Storage, error)

	// Installs a new singleton actor in the state tree.
	SetSingletonActor(address actors.SingletonActorID, balance types.BigInt) (Actor, Storage, error)
}

Wrapper abstracts the inspection and mutation of an implementation-specific state tree and storage. The interface wraps a single, mutable state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL