MCPcopy
hub / github.com/chain/Core / push

Method push

protocol/vm/vm.go:143–155  ·  view source on GitHub ↗
(data []byte, deferred bool)

Source from the content-addressed store, hash-verified

141}
142
143func (vm *virtualMachine) push(data []byte, deferred bool) error {
144 cost := 8 + int64(len(data))
145 if deferred {
146 vm.deferCost(cost)
147 } else {
148 err := vm.applyCost(cost)
149 if err != nil {
150 return err
151 }
152 }
153 vm.dataStack = append(vm.dataStack, data)
154 return nil
155}
156
157func (vm *virtualMachine) pushBool(b bool, deferred bool) error {
158 return vm.push(BoolBytes(b), deferred)

Callers 15

VerifyFunction · 0.95
pushBoolMethod · 0.95
pushInt64Method · 0.95
opAndFunction · 0.80
doOrFunction · 0.80
opAssetFunction · 0.80
opProgramFunction · 0.80
opEntryDataFunction · 0.80
opTxDataFunction · 0.80
opEntryIDFunction · 0.80
opOutputIDFunction · 0.80
opNonceFunction · 0.80

Calls 2

deferCostMethod · 0.95
applyCostMethod · 0.95

Tested by

no test coverage detected