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

Function opDup

protocol/txvm/data.go:15–22  ·  view source on GitHub ↗
(vm *VM)

Source from the content-addressed store, hash-verified

13var ErrInt = errorf("invalid varint")
14
15func opDup(vm *VM) {
16 item, ok := vm.peek().(Data)
17 if !ok {
18 panic(errors.WithData(ErrType, "want", "Data"))
19 }
20 vm.chargeCopy(item)
21 vm.push(item)
22}
23
24func opDrop(vm *VM) {
25 item := vm.pop()

Callers

nothing calls this directly

Calls 4

WithDataFunction · 0.92
chargeCopyMethod · 0.80
peekMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected