Versions in this module Expand all Collapse all v1 v1.18.4 Apr 2, 2024 Changes in this version + const FILE_PREFIX + const TIME_PREFIX + const VAR_PREFIX + var ErrInvalidVersion = errors.New("unsupported engine version") + var ErrNoAccount = errors.New("missing account") + var ErrNoAccountName = errors.New("emoty account name") + var ErrNoBaseKey = errors.New("missing base account key, set with TZCOMPOSE_BASE_KEY") + var ErrNoPipeline = errors.New("missing pipeline definition") + var ErrNoPipelineName = errors.New("empty pipeline name") + var ErrNoTaskType = errors.New("missing task type") + var ErrNoVersion = errors.New("missing engine version") + var ErrSkip = errors.New("skip task") + var NESTED_VAR = regexp.MustCompile(`\$[a-zA-Z0-9_-]+`) + func Clone(ctx Context, version string, cfg CloneConfig) error + func ConvertTime(v string) (string, error) + func CreateVariable(v string) string + func Fetch[T any](ctx Context, url string) (*T, error) + func HasVersion(ver string) bool + func IsFile(v string) bool + func IsTimeExpression(v string) bool + func IsVariable(v string) bool + func Json(v any, indent ...string) string + func ParseFile[T any](fpath string) (*T, error) + func ParseTime(v string) (time.Time, error) + func ParseValue(typ micheline.OpCode, value string) (any, error) + func ReadJsonFile[T any](name string) (*T, error) + func RegisterEngine(ver string, v EngineFactory) + func Run(ctx Context, fpath string, mode RunMode) error + type Account struct + Address mavryk.Address + Id int + PrivateKey mavryk.PrivateKey + type CloneConfig struct + Contract mavryk.Address + IndexUrl string + Mode CloneMode + Name string + NumOps uint + Path string + type CloneMode byte + const CloneModeArgs + const CloneModeBinary + const CloneModeFile + const CloneModeJson + const CloneModeUrl + func (m *CloneMode) Set(s string) (err error) + func (m CloneMode) String() string + type Context struct + Accounts map[mavryk.Address]Account + BaseAccount Account + Contracts map[mavryk.Address]*micheline.Script + Log log.Logger + MaxId int + Variables map[string]string + func NewContext(ctx context.Context) Context + func (c *Context) AddAccount(acc Account) + func (c *Context) AddVariable(key, val string) + func (c *Context) Cache() *PipelineCache + func (c *Context) HeadBlock() *rpc.BlockHeaderLogEntry + func (c *Context) Init() (err error) + func (c *Context) MakeAccount(id int, alias string) (Account, error) + func (c *Context) Params() *mavryk.Params + func (c *Context) ResolveAddress(val any) (a mavryk.Address, err error) + func (c *Context) ResolveInt64(val any) (i int64, err error) + func (c *Context) ResolvePrivateKey(val any) (sk mavryk.PrivateKey, err error) + func (c *Context) ResolveScript(addr mavryk.Address) (*micheline.Script, error) + func (c *Context) ResolveString(val any) (string, error) + func (c *Context) ResolveZ(val any) (z mavryk.Z, err error) + func (c *Context) RestoreLogger() + func (c *Context) Send(op *codec.Op, opts *rpc.CallOptions) (*rpc.Receipt, error) + func (c *Context) SubscribeBlocks(cb rpc.ObserverCallback) (int, error) + func (c *Context) SwitchLogger(tag, lvl string) + func (c *Context) UnsubscribeBlocks(id int) error + func (c *Context) WaitNumBlocks(n int) error + func (c *Context) WithApiKey(k string) *Context + func (c *Context) WithBase(k string) *Context + func (c *Context) WithLogger(l log.Logger) *Context + func (c *Context) WithMode(m RunMode) *Context + func (c *Context) WithPath(p string) *Context + func (c *Context) WithResume(b bool) *Context + func (c *Context) WithUrl(u string) *Context + func (c Context) Fetch(u string, v any) error + func (c Context) Filepath() string + func (c Context) ResolveNestedVars(src string) (string, bool) + func (c Context) ShouldResume() bool + type Engine interface + Clone func(Context, []Op, CloneConfig) ([]byte, error) + Run func(Context, string) error + Validate func(Context, string) error + func New(ver string) Engine + type EngineFactory func() Engine + type Op struct + Amount float64 + Args any + Hash string + Height int + IsInternal bool + OpC int + OpI int + OpP int + PackedCode string + PackedParams string + PackedStorage string + Params ... + Receiver string + Script *micheline.Script + Sender string + Type string + Url string + type PipelineCache struct + func NewCache() *PipelineCache + func (c *PipelineCache) Load(hash uint64, reset bool) error + func (c *PipelineCache) Update(idx int) error + func (c PipelineCache) Get() int + type RunMode byte + const RunModeExecute + const RunModeSimulate + const RunModeValidate + type Spec struct + Filename string + Version string