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

Function opTuple

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

Source from the content-addressed store, hash-verified

61}
62
63func opTuple(vm *VM) {
64 n := int64(vm.popInt())
65 if n > int64(vm.contract.stack.Len()) || n < 0 {
66 panic(errors.Wrapf(errors.WithData(ErrUnderflow, "len(stack)", vm.contract.stack.Len()), "tuple %d", n))
67 }
68 vals := make(Tuple, n)
69 for n > 0 {
70 n--
71 v := vm.popData()
72 vals[n] = v
73 }
74 vm.chargeCreate(vals)
75 vm.push(vals)
76}
77
78func opUntuple(vm *VM) {
79 t := vm.popTuple()

Callers

nothing calls this directly

Calls 7

WrapfFunction · 0.92
WithDataFunction · 0.92
popIntMethod · 0.80
popDataMethod · 0.80
chargeCreateMethod · 0.80
LenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected