Documentation
¶
Overview ¶
Package foundation server implementation of smartcontract functions
Index ¶
- func Call(Reference Reference, MethodName string, Arguments []interface{}) ([]interface{}, error)
- type BaseContract
- func (bc *BaseContract) AddChild(child BaseContractInterface, class Reference) Reference
- func (bc *BaseContract) GetChildrenTyped(r Reference) []BaseContractInterface
- func (bc *BaseContract) GetContext() *CallContext
- func (bc *BaseContract) GetImplementationFor(r Reference) BaseContractInterface
- func (bc *BaseContract) MyReference() Reference
- func (bc *BaseContract) SelfDestructRequest()
- func (bc *BaseContract) SetContext(cc *CallContext)
- func (bc *BaseContract) TakeDelegate(delegate BaseContractInterface, class Reference) Reference
- type BaseContractInterface
- type CBORMarshaler
- type CallContext
- type Reference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseContract ¶
type BaseContract struct {
// contains filtered or unexported fields
}
BaseContract is a base class for all contracts.
func (*BaseContract) AddChild ¶
func (bc *BaseContract) AddChild(child BaseContractInterface, class Reference) Reference
AddChild adds child to contract
func (*BaseContract) GetChildrenTyped ¶
func (bc *BaseContract) GetChildrenTyped(r Reference) []BaseContractInterface
GetChildrenTyped returns set of children objects with corresponding type
func (*BaseContract) GetContext ¶
func (bc *BaseContract) GetContext() *CallContext
GetContext returns current calling context of this object. It exists only for currently called contract.
func (*BaseContract) GetImplementationFor ¶
func (bc *BaseContract) GetImplementationFor(r Reference) BaseContractInterface
GetImplementationFor finds delegate typed r in object and returns it unimplemented
func (*BaseContract) MyReference ¶
func (bc *BaseContract) MyReference() Reference
MyReference - Returns public reference of contract
func (*BaseContract) SelfDestructRequest ¶
func (bc *BaseContract) SelfDestructRequest()
SelfDestructRequest contract will be marked as deleted after call finishes
func (*BaseContract) SetContext ¶
func (bc *BaseContract) SetContext(cc *CallContext)
SetContext - do not use it in smartcontracts
func (*BaseContract) TakeDelegate ¶
func (bc *BaseContract) TakeDelegate(delegate BaseContractInterface, class Reference) Reference
TakeDelegate injects delegate to object
type BaseContractInterface ¶
type BaseContractInterface interface { MyReference() Reference GetImplementationFor(r Reference) BaseContractInterface TakeDelegate(delegate BaseContractInterface, class Reference) Reference }
BaseContractInterface is an interface to deal with any contract same way
func GetImplementationFor ¶
func GetImplementationFor(o Reference, r Reference) BaseContractInterface
GetImplementationFor finds delegate typed r in object and returns it unimplemented
func GetObject ¶
func GetObject(ref Reference) BaseContractInterface
GetObject create proxy by address unimplemented
type CBORMarshaler ¶
CBORMarshaler is a special interface for serializer object
type CallContext ¶
type CallContext struct { Me Reference // My Reference. Caller Reference // Reference of calling contract. Parent Reference // Reference to parent or container contract. Type Reference // Reference to type record on ledger, we have just one type reference, yet. Time time.Time // Time of Calling side made call. Pulse uint64 // Number of current pulse. }
CallContext is a context of contract execution
type Reference ¶
type Reference []byte
Reference is an address of something on ledger.
func SaveToLedger ¶
func SaveToLedger(rec BaseContractInterface) Reference
SaveToLedger saves builder to ledger unimplemented