MCPcopy Create free account
hub / github.com/chain/txvm / Encode

Function Encode

protocol/txvm/item.go:105–109  ·  view source on GitHub ↗

Encode serializes an arbitrary data type in a program, which, when executed, produces that data.

(v Data)

Source from the content-addressed store, hash-verified

103// Encode serializes an arbitrary data type in a program,
104// which, when executed, produces that data.
105func Encode(v Data) []byte {
106 var b bytes.Buffer
107 v.encode(&b)
108 return b.Bytes()
109}
110
111func writePushdata(buf *bytes.Buffer, data []byte) {
112 op := uint64(len(data)) + op.MinPushdata

Callers 9

entryHookMethod · 0.92
writeWitnessHashToMethod · 0.92
HashMethod · 0.92
AssetIDFunction · 0.92
mainFunction · 0.92
contractSnapshotFunction · 0.85
NonceHashFunction · 0.85
opFinalizeFunction · 0.85
opEncodeFunction · 0.85

Calls 2

encodeMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected