parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const STX = "STX"

---- transaction types keyword

Variables

This section is empty.

Functions

func CreateBlockmap

func CreateBlockmap(txs string, txsighex string) string

func CreateSigmap

func CreateSigmap(pubkey_string string, txsighex string) string

func CreateSimpleTxContent

func CreateSimpleTxContent(sender string, receiver string, amount int) string

func MakeKeyword

func MakeKeyword(k string) string

func MakeMap

func MakeMap(m map[string]string) string

func MakeVector

func MakeVector(vectorels []string) string

func ReadMap

func ReadMap(mapstr string) ([]string, []string)

read map and return keys and values as strings

func ReadMapP

func ReadMapP(s string) ([]string, []string)

func ScanScript

func ScanScript(inputVector string) (string, string, string)

[:type {tx} {sig}] extract the components

func SignMap

func SignMap(keypair crypto.Keypair, msg string) string

func StringUnWrap

func StringUnWrap(s string) string

func StringWrap

func StringWrap(s string) string

func TxVector

func TxVector(simpletx string, sigmap string) string

create the vector from tx and sig data

func VerifySigmap

func VerifySigmap(sigmap string, txmap string) bool

func VerifyTxScriptSig

func VerifyTxScriptSig(v string) bool

verify signature independent of balance check

[:simpletx unlock sig]

Types

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner represents a lexical scanner.

func NewScanner

func NewScanner(r io.Reader) *Scanner

NewScanner returns a new instance of Scanner.

func (*Scanner) ReadMap

func (s *Scanner) ReadMap() ([]string, []string)

func (*Scanner) Scan

func (s *Scanner) Scan() (tok Token, lit string)

Scan returns the next token and literal value.

type Token

type Token int

Token represents a lexical token.

const (
	// Special tokens
	ILLEGAL Token = iota
	EOF
	WS

	IDENT
	KEYWORD
	OPENMAP
	CLOSEMAP
	OPENVECTOR
	//
	MAPCONTENT
	SIMPLETX
)

Jump to

Keyboard shortcuts

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