foundation

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package foundation server implementation of smartcontract functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportPublicKey added in v0.6.3

func ExportPublicKey(publicKey crypto.PublicKey) (string, error)

func ExtractPublicKey added in v0.6.3

func ExtractPublicKey(privateKey crypto.PrivateKey) crypto.PublicKey

func GeneratePrivateKey added in v0.6.3

func GeneratePrivateKey() (crypto.PrivateKey, error)

func GetContext added in v0.4.0

func GetContext() *core.LogicCallContext

GetContext returns current calling context.

func GetImplementationFor

func GetImplementationFor(object, ofType core.RecordRef) (core.RecordRef, error)

GetImplementationFor finds delegate typed r in object and returns it

func ImportPublicKey added in v0.6.3

func ImportPublicKey(publicKey string) (crypto.PublicKey, error)

func Sign added in v0.6.3

func Sign(data []byte, key crypto.PrivateKey) ([]byte, error)

Sign signs given seed.

func Verify added in v0.6.3

func Verify(data []byte, signatureRaw []byte, publicKey crypto.PublicKey) bool

Verify verifies signature.

Types

type BaseContract

type BaseContract struct {
}

BaseContract is a base class for all contracts.

func (*BaseContract) GetCode added in v0.6.3

func (bc *BaseContract) GetCode() core.RecordRef

GetCode - Returns prototype of contract

func (*BaseContract) GetContext

func (bc *BaseContract) GetContext() *core.LogicCallContext

GetContext returns current calling context OBSOLETED.

func (*BaseContract) GetPrototype added in v0.6.2

func (bc *BaseContract) GetPrototype() core.RecordRef

GetPrototype - Returns prototype of contract

func (*BaseContract) GetReference added in v0.0.6

func (bc *BaseContract) GetReference() core.RecordRef

GetReference - Returns public reference of contract

func (*BaseContract) NewChildrenTypedIterator added in v0.7.5

func (bc *BaseContract) NewChildrenTypedIterator(childPrototype core.RecordRef) (*proxyctx.ChildrenTypedIterator, error)

NewChildrenTypedIterator returns children with corresponding type iterator

func (*BaseContract) SelfDestruct added in v0.6.0

func (bc *BaseContract) SelfDestruct() error

SelfDestruct contract will be marked as deleted

type BaseContractInterface

type BaseContractInterface interface {
	GetReference() core.RecordRef
	GetPrototype() core.RecordRef
	GetCode() core.RecordRef
}

BaseContractInterface is an interface to deal with any contract same way

type Error added in v0.4.0

type Error struct {
	S string
}

Error elementary string based error struct satisfying builtin error interface

foundation.Error{"some err"}

func (*Error) Error added in v0.4.0

func (e *Error) Error() string

Error returns error in string format

type ProxyInterface added in v0.0.6

type ProxyInterface interface {
	GetReference() core.RecordRef
	GetPrototype() (core.RecordRef, error)
	GetCode() (core.RecordRef, error)
}

ProxyInterface interface any proxy of a contract implements

func GetObject

func GetObject(ref core.RecordRef) ProxyInterface

GetObject create proxy by address unimplemented

Jump to

Keyboard shortcuts

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