Documentation ¶
Index ¶
- func AMPublishCode(t testing.TB, am core.ArtifactManager, domain core.RecordRef, ...) (typeRef *core.RecordRef, codeRef *core.RecordRef, protoRef *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 PrependGoPath(path string) string
- func StartInsgorund(cmdPath, lProto, listen, upstreamProto, upstreamAddr string) (func(), error)
- func WriteFile(dir string, name string, text string) error
- type ContractsBuilder
- type TestArtifactManager
- func (t *TestArtifactManager) ActivateObject(ctx context.Context, domain, request, parent, prototype core.RecordRef, ...) (core.ObjectDescriptor, error)
- func (t *TestArtifactManager) ActivatePrototype(ctx context.Context, domain, request, parent, code core.RecordRef, ...) (core.ObjectDescriptor, error)
- func (t *TestArtifactManager) DeactivateObject(ctx context.Context, domain core.RecordRef, request core.RecordRef, ...) (*core.RecordID, error)
- func (t *TestArtifactManager) DeclareType(ctx context.Context, domain core.RecordRef, request core.RecordRef, ...) (*core.RecordID, error)
- func (t *TestArtifactManager) DeployCode(ctx context.Context, domain core.RecordRef, request core.RecordRef, ...) (*core.RecordID, error)
- func (t *TestArtifactManager) GenesisRef() *core.RecordRef
- func (t *TestArtifactManager) GetChildren(ctx context.Context, parent core.RecordRef, pulse *core.PulseNumber) (core.RefIterator, error)
- func (t *TestArtifactManager) GetCode(ctx context.Context, code core.RecordRef) (core.CodeDescriptor, error)
- func (t *TestArtifactManager) GetDelegate(ctx context.Context, head, asClass core.RecordRef) (*core.RecordRef, error)
- func (t *TestArtifactManager) GetObject(ctx context.Context, object core.RecordRef, state *core.RecordID, ...) (core.ObjectDescriptor, error)
- func (t *TestArtifactManager) HasPendingRequests(ctx context.Context, object core.RecordRef) (bool, error)
- func (t *TestArtifactManager) RegisterRequest(ctx context.Context, obj core.RecordRef, parcel core.Parcel) (*core.RecordID, error)
- func (t *TestArtifactManager) RegisterResult(ctx context.Context, object, request core.RecordRef, payload []byte) (*core.RecordID, error)
- func (t *TestArtifactManager) RegisterValidation(ctx context.Context, object core.RecordRef, state core.RecordID, isValid bool, ...) error
- func (t *TestArtifactManager) State() ([]byte, error)
- func (t *TestArtifactManager) UpdateObject(ctx context.Context, domain core.RecordRef, request core.RecordRef, ...) (core.ObjectDescriptor, error)
- func (t *TestArtifactManager) UpdatePrototype(ctx context.Context, domain core.RecordRef, request core.RecordRef, ...) (core.ObjectDescriptor, error)
- type TestCodeDescriptor
- type TestObjectDescriptor
- func (t *TestObjectDescriptor) ChildPointer() *core.RecordID
- func (t *TestObjectDescriptor) Children(pulse *core.PulseNumber) (core.RefIterator, error)
- func (t *TestObjectDescriptor) Code() (*core.RecordRef, error)
- func (t *TestObjectDescriptor) HasPendingRequests() bool
- func (t *TestObjectDescriptor) HeadRef() *core.RecordRef
- func (t *TestObjectDescriptor) IsPrototype() bool
- func (t *TestObjectDescriptor) Memory() []byte
- func (t *TestObjectDescriptor) Parent() *core.RecordRef
- func (t *TestObjectDescriptor) Prototype() (*core.RecordRef, error)
- func (t *TestObjectDescriptor) StateID() *core.RecordID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AMPublishCode ¶
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, protoRef *core.RecordRef, err error, )
AMPublishCode publishes code on ledger
func CBORMarshal ¶
CBORMarshal - testing serialize helper
func CBORUnMarshal ¶
CBORUnMarshal - testing deserialize helper
func CBORUnMarshalToSlice ¶
CBORUnMarshalToSlice - wrapper for CBORUnMarshal, expects slice
func PrependGoPath ¶
PrependGoPath prepends `path` to GOPATH environment variable accounting for possibly for default value. Returns new value. NOTE: that environment is not changed
func StartInsgorund ¶ added in v0.6.2
StartInsgorund starts `insgorund` process
Types ¶
type ContractsBuilder ¶
type ContractsBuilder struct { ArtifactManager core.ArtifactManager IccPath string Prototypes map[string]*core.RecordRef Codes map[string]*core.RecordRef // contains filtered or unexported fields }
ContractsBuilder for tests
func NewContractBuilder ¶
func NewContractBuilder(am core.ArtifactManager, icc string) *ContractsBuilder
NewContractBuilder returns a new `ContractsBuilder`, takes in: path to tmp directory, artifact manager, ...
func (*ContractsBuilder) Build ¶
func (cb *ContractsBuilder) Build(contracts map[string]string) error
Build ...
func (*ContractsBuilder) Clean ¶
func (cb *ContractsBuilder) Clean()
Clean deletes tmp directory used for contracts building
type TestArtifactManager ¶
type TestArtifactManager struct { Types []core.MachineType Codes map[core.RecordRef]*TestCodeDescriptor Objects map[core.RecordRef]*TestObjectDescriptor Prototypes map[core.RecordRef]*TestObjectDescriptor }
TestArtifactManager implementation for tests
func NewTestArtifactManager ¶
func NewTestArtifactManager() *TestArtifactManager
NewTestArtifactManager implementation for tests
func (*TestArtifactManager) ActivateObject ¶
func (t *TestArtifactManager) ActivateObject( ctx context.Context, domain, request, parent, prototype core.RecordRef, asDelegate bool, memory []byte, ) (core.ObjectDescriptor, error)
ActivateObject implementation for tests
func (*TestArtifactManager) ActivatePrototype ¶ added in v0.6.2
func (t *TestArtifactManager) ActivatePrototype( ctx context.Context, domain, request, parent, code core.RecordRef, memory []byte, ) (core.ObjectDescriptor, error)
ActivatePrototype implementation for tests
func (*TestArtifactManager) DeactivateObject ¶
func (t *TestArtifactManager) DeactivateObject( ctx context.Context, domain core.RecordRef, request core.RecordRef, obj core.ObjectDescriptor, ) (*core.RecordID, error)
DeactivateObject implementation for tests
func (*TestArtifactManager) DeclareType ¶
func (t *TestArtifactManager) DeclareType(ctx context.Context, domain core.RecordRef, request core.RecordRef, typeDec []byte) (*core.RecordID, error)
DeclareType implementation for tests
func (*TestArtifactManager) DeployCode ¶
func (t *TestArtifactManager) DeployCode(ctx context.Context, domain core.RecordRef, request core.RecordRef, code []byte, mt core.MachineType) (*core.RecordID, error)
DeployCode implementation for tests
func (*TestArtifactManager) GenesisRef ¶
func (t *TestArtifactManager) GenesisRef() *core.RecordRef
GenesisRef implementation for tests
func (*TestArtifactManager) GetChildren ¶
func (t *TestArtifactManager) GetChildren(ctx context.Context, parent core.RecordRef, pulse *core.PulseNumber) (core.RefIterator, error)
GetChildren implementation for tests
func (*TestArtifactManager) GetCode ¶
func (t *TestArtifactManager) GetCode(ctx context.Context, code core.RecordRef) (core.CodeDescriptor, error)
GetCode implementation for tests
func (*TestArtifactManager) GetDelegate ¶
func (t *TestArtifactManager) GetDelegate(ctx context.Context, head, asClass core.RecordRef) (*core.RecordRef, error)
GetDelegate implementation for tests
func (*TestArtifactManager) GetObject ¶
func (t *TestArtifactManager) GetObject(ctx context.Context, object core.RecordRef, state *core.RecordID, approved bool) (core.ObjectDescriptor, error)
GetObject implementation for tests
func (*TestArtifactManager) HasPendingRequests ¶ added in v0.7.5
func (*TestArtifactManager) RegisterRequest ¶
func (t *TestArtifactManager) RegisterRequest(ctx context.Context, obj core.RecordRef, parcel core.Parcel) (*core.RecordID, error)
RegisterRequest implementation for tests
func (*TestArtifactManager) RegisterResult ¶ added in v0.6.2
func (t *TestArtifactManager) RegisterResult( ctx context.Context, object, request core.RecordRef, payload []byte, ) (*core.RecordID, error)
RegisterResult saves VM method call result.
func (*TestArtifactManager) RegisterValidation ¶ added in v0.6.2
func (t *TestArtifactManager) RegisterValidation( ctx context.Context, object core.RecordRef, state core.RecordID, isValid bool, validationMessages []core.Message, ) error
RegisterValidation implementation for tests
func (*TestArtifactManager) State ¶ added in v0.6.3
func (t *TestArtifactManager) State() ([]byte, error)
State implementation for tests
func (*TestArtifactManager) UpdateObject ¶
func (t *TestArtifactManager) UpdateObject( ctx context.Context, domain core.RecordRef, request core.RecordRef, object core.ObjectDescriptor, memory []byte, ) (core.ObjectDescriptor, error)
UpdateObject implementation for tests
func (*TestArtifactManager) UpdatePrototype ¶ added in v0.6.2
func (t *TestArtifactManager) UpdatePrototype( ctx context.Context, domain core.RecordRef, request core.RecordRef, object core.ObjectDescriptor, memory []byte, code *core.RecordRef, ) (core.ObjectDescriptor, error)
UpdatePrototype implementation for tests
type TestCodeDescriptor ¶
type TestCodeDescriptor struct { ARef core.RecordRef ACode []byte AMachineType core.MachineType }
TestCodeDescriptor implementation for tests
func (*TestCodeDescriptor) Code ¶
func (t *TestCodeDescriptor) Code() ([]byte, error)
Code implementation for tests
func (*TestCodeDescriptor) MachineType ¶
func (t *TestCodeDescriptor) MachineType() core.MachineType
MachineType implementation for tests
func (*TestCodeDescriptor) Ref ¶
func (t *TestCodeDescriptor) Ref() *core.RecordRef
Ref implementation for tests
type TestObjectDescriptor ¶
type TestObjectDescriptor struct { AM *TestArtifactManager ARef *core.RecordRef Data []byte State *core.RecordID PrototypeRef *core.RecordRef Delegates map[core.RecordRef]core.RecordRef ChildrenContainer []core.RecordRef }
TestObjectDescriptor implementation for tests
func (*TestObjectDescriptor) ChildPointer ¶ added in v0.6.2
func (t *TestObjectDescriptor) ChildPointer() *core.RecordID
ChildPointer implementation for tests
func (*TestObjectDescriptor) Children ¶
func (t *TestObjectDescriptor) Children(pulse *core.PulseNumber) (core.RefIterator, error)
Children implementation for tests
func (*TestObjectDescriptor) Code ¶
func (t *TestObjectDescriptor) Code() (*core.RecordRef, error)
Code implementation for tests
func (*TestObjectDescriptor) HasPendingRequests ¶ added in v0.7.5
func (t *TestObjectDescriptor) HasPendingRequests() bool
func (*TestObjectDescriptor) HeadRef ¶
func (t *TestObjectDescriptor) HeadRef() *core.RecordRef
HeadRef implementation for tests
func (*TestObjectDescriptor) IsPrototype ¶ added in v0.6.2
func (t *TestObjectDescriptor) IsPrototype() bool
IsPrototype implementation for tests
func (*TestObjectDescriptor) Memory ¶
func (t *TestObjectDescriptor) Memory() []byte
Memory implementation for tests
func (*TestObjectDescriptor) Parent ¶ added in v0.6.2
func (t *TestObjectDescriptor) Parent() *core.RecordRef
Parent implementation for tests
func (*TestObjectDescriptor) Prototype ¶ added in v0.6.2
func (t *TestObjectDescriptor) Prototype() (*core.RecordRef, error)
Prototype implementation for tests
func (*TestObjectDescriptor) StateID ¶
func (t *TestObjectDescriptor) StateID() *core.RecordID
StateID implementation for tests