MCPcopy Create free account
hub / github.com/btcsuite/btcd / parseWitnessStack

Function parseWitnessStack

txscript/reference_test.go:117–129  ·  view source on GitHub ↗

parseWitnessStack parses a json array of witness items encoded as hex into a slice of witness elements.

(elements []interface{})

Source from the content-addressed store, hash-verified

115// parseWitnessStack parses a json array of witness items encoded as hex into a
116// slice of witness elements.
117func parseWitnessStack(elements []interface{}) ([][]byte, error) {
118 witness := make([][]byte, len(elements))
119 for i, e := range elements {
120 witElement, err := hex.DecodeString(e.(string))
121 if err != nil {
122 return nil, err
123 }
124
125 witness[i] = witElement
126 }
127
128 return witness, nil
129}
130
131// shortFormOps holds a map of opcode names to values for use in short form
132// parsing. It is declared here so it only needs to be created once.

Callers 1

testScriptsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…