Documentation ¶
Index ¶
- func AMPublishCode(t testing.TB, am core.ArtifactManager, domain core.RecordRef, ...) (typeRef *core.RecordRef, codeRef *core.RecordRef, classRef *core.RecordRef, ...)
- func Build() (string, string, error)
- func CBORMarshal(t testing.TB, o interface{}) []byte
- func CBORUnMarshal(t testing.TB, data []byte) interface{}
- func CBORUnMarshalToSlice(t testing.TB, in []byte) []interface{}
- func ChangeGoPath(path string) (string, error)
- func WriteFile(dir string, name string, text string) error
- type ContractsBuilder
- type TestArtifactManager
- func (t *TestArtifactManager) ActivateClass(domain core.RecordRef, request core.RecordRef) (*core.RecordRef, error)
- func (t *TestArtifactManager) ActivateObj(domain core.RecordRef, request core.RecordRef, class core.RecordRef, ...) (*core.RecordRef, error)
- func (t *TestArtifactManager) ActivateObjDelegate(domain, request, class, parent core.RecordRef, memory []byte) (*core.RecordRef, error)
- func (t *TestArtifactManager) DeactivateClass(domain core.RecordRef, request core.RecordRef, class core.RecordRef) (*core.RecordRef, error)
- func (t *TestArtifactManager) DeactivateObj(domain core.RecordRef, request core.RecordRef, obj core.RecordRef) (*core.RecordRef, error)
- func (t *TestArtifactManager) DeclareType(domain core.RecordRef, request core.RecordRef, typeDec []byte) (*core.RecordRef, error)
- func (t *TestArtifactManager) DeployCode(domain core.RecordRef, request core.RecordRef, ...) (*core.RecordRef, error)
- func (t *TestArtifactManager) GetCode(code core.RecordRef) (core.CodeDescriptor, error)
- func (t *TestArtifactManager) GetExactObj(class core.RecordRef, object core.RecordRef) ([]byte, []byte, error)
- func (t *TestArtifactManager) GetLatestClass(object core.RecordRef) (core.ClassDescriptor, error)
- func (t *TestArtifactManager) GetLatestObj(object core.RecordRef) (core.ObjectDescriptor, error)
- func (t *TestArtifactManager) GetObjChildren(head core.RecordRef) (core.RefIterator, error)
- func (t *TestArtifactManager) GetObjDelegate(head, asClass core.RecordRef) (*core.RecordRef, error)
- func (t *TestArtifactManager) RootRef() *core.RecordRef
- func (t *TestArtifactManager) SetArchPref(pref []core.MachineType)
- func (t *TestArtifactManager) Start(components core.Components) error
- func (t *TestArtifactManager) Stop() error
- func (t *TestArtifactManager) UpdateClass(domain core.RecordRef, request core.RecordRef, class core.RecordRef, ...) (*core.RecordRef, error)
- func (t *TestArtifactManager) UpdateObj(domain core.RecordRef, request core.RecordRef, obj core.RecordRef, ...) (*core.RecordRef, error)
- type TestClassDescriptor
- type TestCodeDescriptor
- type TestMessageRouter
- type TestObjectDescriptor
- func (t *TestObjectDescriptor) ClassDescriptor() (core.ClassDescriptor, error)
- func (t *TestObjectDescriptor) CodeDescriptor() (core.CodeDescriptor, error)
- func (t *TestObjectDescriptor) HeadRef() *core.RecordRef
- func (t *TestObjectDescriptor) Memory() ([]byte, error)
- func (t *TestObjectDescriptor) StateRef() *core.RecordRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AMPublishCode ¶ added in v0.0.6
func AMPublishCode( t testing.TB, am core.ArtifactManager, domain core.RecordRef, request core.RecordRef, mtype core.MachineType, code []byte, ) ( typeRef *core.RecordRef, codeRef *core.RecordRef, classRef *core.RecordRef, err error, )
AMPublishCode publishes code on ledger
func CBORMarshal ¶ added in v0.0.6
CBORMarshal - testing serialize helper
func CBORUnMarshal ¶ added in v0.0.6
CBORUnMarshal - testing deserialize helper
func CBORUnMarshalToSlice ¶ added in v0.2.0
CBORUnMarshalToSlice - wrapper for CBORUnMarshal, expects slice
func ChangeGoPath ¶
ChangeGoPath prepends `path` to GOPATH environment variable accounting for possibly for default value. Returns original value of the enviroment variable, don't forget to restore it with defer:
defer os.Setenv("GOPATH", origGoPath)
Types ¶
type ContractsBuilder ¶ added in v0.0.6
type ContractsBuilder struct { ArtifactManager core.ArtifactManager IccPath string Classes map[string]*core.RecordRef Codes map[string]*core.RecordRef // contains filtered or unexported fields }
ContractsBuilder for tests
func NewContractBuilder ¶ added in v0.0.6
func NewContractBuilder(am core.ArtifactManager, icc string) (*ContractsBuilder, func())
NewContractBuilder returns a new `ContractsBuilder`, takes in: path to tmp directory, artifact manager, ...
type TestArtifactManager ¶ added in v0.0.6
type TestArtifactManager struct { Types []core.MachineType Codes map[core.RecordRef]*TestCodeDescriptor Objects map[core.RecordRef]*TestObjectDescriptor Classes map[core.RecordRef]*TestClassDescriptor }
TestArtifactManager implementation for tests
func NewTestArtifactManager ¶ added in v0.0.6
func NewTestArtifactManager() *TestArtifactManager
NewTestArtifactManager implementation for tests
func (*TestArtifactManager) ActivateClass ¶ added in v0.0.6
func (t *TestArtifactManager) ActivateClass(domain core.RecordRef, request core.RecordRef) (*core.RecordRef, error)
ActivateClass implementation for tests
func (*TestArtifactManager) ActivateObj ¶ added in v0.0.6
func (t *TestArtifactManager) ActivateObj(domain core.RecordRef, request core.RecordRef, class core.RecordRef, parent core.RecordRef, memory []byte) (*core.RecordRef, error)
ActivateObj implementation for tests
func (*TestArtifactManager) ActivateObjDelegate ¶ added in v0.0.6
func (t *TestArtifactManager) ActivateObjDelegate(domain, request, class, parent core.RecordRef, memory []byte) (*core.RecordRef, error)
ActivateObjDelegate implementation for tests
func (*TestArtifactManager) DeactivateClass ¶ added in v0.0.6
func (t *TestArtifactManager) DeactivateClass(domain core.RecordRef, request core.RecordRef, class core.RecordRef) (*core.RecordRef, error)
DeactivateClass implementation for tests
func (*TestArtifactManager) DeactivateObj ¶ added in v0.0.6
func (t *TestArtifactManager) DeactivateObj(domain core.RecordRef, request core.RecordRef, obj core.RecordRef) (*core.RecordRef, error)
DeactivateObj implementation for tests
func (*TestArtifactManager) DeclareType ¶ added in v0.0.6
func (t *TestArtifactManager) DeclareType(domain core.RecordRef, request core.RecordRef, typeDec []byte) (*core.RecordRef, error)
DeclareType implementation for tests
func (*TestArtifactManager) DeployCode ¶ added in v0.0.6
func (t *TestArtifactManager) DeployCode(domain core.RecordRef, request core.RecordRef, codeMap map[core.MachineType][]byte) (*core.RecordRef, error)
DeployCode implementation for tests
func (*TestArtifactManager) GetCode ¶ added in v0.0.6
func (t *TestArtifactManager) GetCode(code core.RecordRef) (core.CodeDescriptor, error)
GetCode implementation for tests
func (*TestArtifactManager) GetExactObj ¶ added in v0.0.6
func (t *TestArtifactManager) GetExactObj(class core.RecordRef, object core.RecordRef) ([]byte, []byte, error)
GetExactObj implementation for tests
func (*TestArtifactManager) GetLatestClass ¶ added in v0.0.6
func (t *TestArtifactManager) GetLatestClass(object core.RecordRef) (core.ClassDescriptor, error)
GetLatestClass implementation for tests
func (*TestArtifactManager) GetLatestObj ¶ added in v0.0.6
func (t *TestArtifactManager) GetLatestObj(object core.RecordRef) (core.ObjectDescriptor, error)
GetLatestObj implementation for tests
func (*TestArtifactManager) GetObjChildren ¶ added in v0.0.6
func (t *TestArtifactManager) GetObjChildren(head core.RecordRef) (core.RefIterator, error)
GetObjChildren implementation for tests
func (*TestArtifactManager) GetObjDelegate ¶ added in v0.0.6
GetObjDelegate implementation for tests
func (*TestArtifactManager) RootRef ¶ added in v0.0.6
func (t *TestArtifactManager) RootRef() *core.RecordRef
RootRef implementation for tests
func (*TestArtifactManager) SetArchPref ¶ added in v0.0.6
func (t *TestArtifactManager) SetArchPref(pref []core.MachineType)
SetArchPref implementation for tests
func (*TestArtifactManager) Start ¶ added in v0.0.6
func (t *TestArtifactManager) Start(components core.Components) error
Start implementation for tests
func (*TestArtifactManager) Stop ¶ added in v0.0.6
func (t *TestArtifactManager) Stop() error
Stop implementation for tests
type TestClassDescriptor ¶ added in v0.0.6
type TestClassDescriptor struct { AM *TestArtifactManager ARef *core.RecordRef ACode *core.RecordRef }
TestClassDescriptor ...
func (*TestClassDescriptor) CodeDescriptor ¶ added in v0.0.6
func (t *TestClassDescriptor) CodeDescriptor() (core.CodeDescriptor, error)
CodeDescriptor ...
func (*TestClassDescriptor) HeadRef ¶ added in v0.0.6
func (t *TestClassDescriptor) HeadRef() *core.RecordRef
HeadRef ...
func (*TestClassDescriptor) StateRef ¶ added in v0.0.6
func (t *TestClassDescriptor) StateRef() *core.RecordRef
StateRef ...
type TestCodeDescriptor ¶ added in v0.0.6
type TestCodeDescriptor struct { ARef *core.RecordRef ACode []byte AMachineType core.MachineType }
TestCodeDescriptor implementation for tests
func (*TestCodeDescriptor) Code ¶ added in v0.0.6
func (t *TestCodeDescriptor) Code() ([]byte, error)
Code implementation for tests
func (*TestCodeDescriptor) MachineType ¶ added in v0.0.6
func (t *TestCodeDescriptor) MachineType() (core.MachineType, error)
MachineType implementation for tests
func (*TestCodeDescriptor) Ref ¶ added in v0.0.6
func (t *TestCodeDescriptor) Ref() *core.RecordRef
Ref implementation for tests
type TestMessageRouter ¶ added in v0.2.0
type TestMessageRouter struct {
LogicRunner core.LogicRunner
}
TestMessageRouter can execute messages on LogicRunner.
func NewTestMessageRouter ¶ added in v0.2.0
func NewTestMessageRouter(lr core.LogicRunner) *TestMessageRouter
NewTestMessageRouter creates TestMessageRouter which mocks the real one.
func (*TestMessageRouter) Start ¶ added in v0.2.0
func (*TestMessageRouter) Start(components core.Components) error
Start is the dummy mock of Start method.
func (*TestMessageRouter) Stop ¶ added in v0.2.0
func (*TestMessageRouter) Stop() error
Stop is the dummy mock of Stop method.
type TestObjectDescriptor ¶ added in v0.0.6
type TestObjectDescriptor struct { AM *TestArtifactManager Data []byte Code *core.RecordRef Class *core.RecordRef Delegates map[core.RecordRef]core.RecordRef }
TestObjectDescriptor implementation for tests
func (*TestObjectDescriptor) ClassDescriptor ¶ added in v0.0.6
func (t *TestObjectDescriptor) ClassDescriptor() (core.ClassDescriptor, error)
ClassDescriptor implementation for tests
func (*TestObjectDescriptor) CodeDescriptor ¶ added in v0.0.6
func (t *TestObjectDescriptor) CodeDescriptor() (core.CodeDescriptor, error)
CodeDescriptor implementation for tests
func (*TestObjectDescriptor) HeadRef ¶ added in v0.0.6
func (t *TestObjectDescriptor) HeadRef() *core.RecordRef
HeadRef implementation for tests
func (*TestObjectDescriptor) Memory ¶ added in v0.0.6
func (t *TestObjectDescriptor) Memory() ([]byte, error)
Memory implementation for tests
func (*TestObjectDescriptor) StateRef ¶ added in v0.0.6
func (t *TestObjectDescriptor) StateRef() *core.RecordRef
StateRef implementation for tests