vmutil

package
v0.0.0-...-414a959 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2017 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadValue       = errors.New("bad value")
	ErrMultisigFormat = errors.New("bad multisig program format")
)

Functions

func BlockMultiSigProgram

func BlockMultiSigProgram(pubkeys []ed25519.PublicKey, nrequired int) ([]byte, error)

BlockMultiSigProgram returns a valid multisignature consensus program where nrequired of the keys in pubkeys are required to have signed the block for success. An ErrBadValue will be returned if nrequired is larger than the number of keys provided. The result is: BLOCKSIGHASH <pubkey>... <nrequired> <npubkeys> CHECKMULTISIG

func IsUnspendable

func IsUnspendable(prog []byte) bool

func P2SPMultiSigProgram

func P2SPMultiSigProgram(pubkeys []ed25519.PublicKey, nrequired int) ([]byte, error)

func ParseBlockMultiSigProgram

func ParseBlockMultiSigProgram(script []byte) ([]ed25519.PublicKey, int, error)

func ParseP2SPMultiSigProgram

func ParseP2SPMultiSigProgram(program []byte) ([]ed25519.PublicKey, int, error)

Types

type Builder

type Builder struct {
	Program []byte
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) AddData

func (b *Builder) AddData(data []byte) *Builder

func (*Builder) AddInt64

func (b *Builder) AddInt64(n int64) *Builder

func (*Builder) AddOp

func (b *Builder) AddOp(op vm.Op) *Builder

func (*Builder) AddRawBytes

func (b *Builder) AddRawBytes(data []byte) *Builder

Jump to

Keyboard shortcuts

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