MCPcopy Create free account
hub / github.com/DNAProject/DNA / PushAsArray

Method PushAsArray

vm/neovm/value_stack.go:111–126  ·  view source on GitHub ↗
(vals []types.VmValue)

Source from the content-addressed store, hash-verified

109}
110
111func (self *ValueStack) PushAsArray(vals []types.VmValue) error {
112
113 if int64(len(self.data)+1) > self.limit {
114 return errors.ERR_OVER_STACK_LEN
115 }
116 arrayValue := types.NewArrayValue()
117 for _, val := range vals {
118 err := arrayValue.Append(val)
119 if err != nil {
120 return err
121 }
122 }
123 v := types.VmValueFromArrayVal(arrayValue)
124 self.data = append(self.data, v)
125 return nil
126}
127
128func (self *ValueStack) Pop() (value types.VmValue, err error) {
129 length := len(self.data)

Callers 2

TransactionGetAttributesFunction · 0.80
BlockGetTransactionsFunction · 0.80

Calls 3

AppendMethod · 0.95
NewArrayValueFunction · 0.92
VmValueFromArrayValFunction · 0.92

Tested by

no test coverage detected