MCPcopy Create free account
hub / github.com/chain/Core / code

Method code

core/txbuilder/constraint.go:67–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67func (r refdataConstraint) code() []byte {
68 var h [32]byte
69 sha3pool.Sum256(h[:], r.data)
70 builder := vmutil.NewBuilder()
71 builder.AddData(h[:])
72 if r.tx {
73 builder.AddOp(vm.OP_TXDATA)
74 } else {
75 builder.AddOp(vm.OP_ENTRYDATA)
76 }
77 builder.AddOp(vm.OP_EQUAL)
78 return builder.Program
79}
80
81// PayConstraint requires the transaction to include a given output
82// at the given index, optionally with the given refdatahash.

Callers

nothing calls this directly

Calls 2

AddDataMethod · 0.95
AddOpMethod · 0.95

Tested by

no test coverage detected