MCPcopy Index your code
hub / github.com/chain/Core / opSub

Function opSub

protocol/vm/numeric.go:147–165  ·  view source on GitHub ↗
(vm *virtualMachine)

Source from the content-addressed store, hash-verified

145}
146
147func opSub(vm *virtualMachine) error {
148 err := vm.applyCost(2)
149 if err != nil {
150 return err
151 }
152 y, err := vm.popInt64(true)
153 if err != nil {
154 return err
155 }
156 x, err := vm.popInt64(true)
157 if err != nil {
158 return err
159 }
160 res, ok := checked.SubInt64(x, y)
161 if !ok {
162 return ErrRange
163 }
164 return vm.pushInt64(res, true)
165}
166
167func opMul(vm *virtualMachine) error {
168 err := vm.applyCost(8)

Callers

nothing calls this directly

Calls 3

applyCostMethod · 0.80
popInt64Method · 0.80
pushInt64Method · 0.80

Tested by

no test coverage detected