Documentation
¶
Overview ¶
Provides `Machine`, which executes programs and outputs postings. 1: Create New Machine 2: Set Variables (with `core.Value`s or JSON) 3: Resolve Resources (answer requests on channel) 4: Resolve Balances (answer requests on channel) 6: Execute
Index ¶
- Constants
- func StdOutPrinter(c chan core.Value)
- type BalanceRequest
- type Machine
- func (m *Machine) Execute() (byte, error)
- func (m *Machine) GetAccountsMetaJSON() Metadata
- func (m *Machine) GetTxMetaJSON() Metadata
- func (m *Machine) ResolveBalances() (chan BalanceRequest, error)
- func (m *Machine) ResolveResources() (chan ResourceRequest, error)
- func (m *Machine) SetVars(vars map[string]core.Value) error
- func (m *Machine) SetVarsFromJSON(vars map[string]json.RawMessage) error
- type Metadata
- type Posting
- type ResourceRequest
Constants ¶
View Source
const ( EXIT_OK = byte(iota + 1) EXIT_FAIL EXIT_FAIL_INVALID EXIT_FAIL_INSUFFICIENT_FUNDS )
Variables ¶
This section is empty.
Functions ¶
func StdOutPrinter ¶
Types ¶
type BalanceRequest ¶
type BalanceRequest struct { Account string Asset string Response chan *core.MonetaryInt Error error }
type Machine ¶
type Machine struct { P uint Program program.Program Vars map[string]core.Value UnresolvedResources []program.Resource Resources []core.Value // Constants and Variables Balances map[core.AccountAddress]map[core.Asset]*core.MonetaryInt // keeps track of balances throughout execution Stack []core.Value Postings []Posting // accumulates postings throughout execution TxMeta map[string]core.Value // accumulates transaction meta throughout execution AccountsMeta map[core.AccountAddress]map[string]core.Value // accumulates accounts meta throughout execution Printer func(chan core.Value) Debug bool // contains filtered or unexported fields }
func NewMachine ¶
func (*Machine) GetAccountsMetaJSON ¶
func (*Machine) GetTxMetaJSON ¶
func (*Machine) ResolveBalances ¶
func (m *Machine) ResolveBalances() (chan BalanceRequest, error)
func (*Machine) ResolveResources ¶
func (m *Machine) ResolveResources() (chan ResourceRequest, error)
func (*Machine) SetVarsFromJSON ¶
func (m *Machine) SetVarsFromJSON(vars map[string]json.RawMessage) error
Click to show internal directories.
Click to hide internal directories.