parsescript

package
v0.0.0-...-0cf96f8 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPushOnly

func IsPushOnly(pops []ParsedOpcode) bool

IsPushOnly returns true if the script only pushes data, false otherwise.

Types

type ParsedOpcode

type ParsedOpcode struct {
	Opcode opcode.Opcode
	Data   []byte
}

ParsedOpcode represents an opcode that has been parsed and includes any potential data associated with it.

func ParseScript

func ParseScript(script []byte) ([]ParsedOpcode, er.R)

parseScript preparses the script in bytes into a list of parsedOpcodes while applying a number of sanity checks.

func ParseScriptTemplate

func ParseScriptTemplate(script []byte, opcodes map[byte]opcode.Opcode) ([]ParsedOpcode, er.R)

ParseScriptTemplate is the same as ParseScript but allows the passing of the template list for testing purposes. When there are parse errors, it returns the list of parsed opcodes up to the point of failure along with the error.

Jump to

Keyboard shortcuts

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