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

Method validate

protocol/txvm/vm.go:122–135  ·  view source on GitHub ↗
(txprog []byte)

Source from the content-addressed store, hash-verified

120}
121
122func (vm *VM) validate(txprog []byte) (err error) {
123 defer vm.recoverError(&err)
124
125 if int64(len(txprog)) > vm.runlimit {
126 return vm.wraperr(ErrRunlimit)
127 }
128
129 vm.exec(txprog)
130
131 if !vm.stopAfterFinalize && (!vm.contract.stack.isEmpty() || !vm.argstack.isEmpty()) {
132 return vm.wraperr(ErrResidue)
133 }
134 return nil
135}
136
137func (vm *VM) exec(prog []byte) {
138 if len(vm.run.prog) > 0 {

Callers 1

ValidateFunction · 0.95

Calls 4

recoverErrorMethod · 0.95
wraperrMethod · 0.95
execMethod · 0.95
isEmptyMethod · 0.80

Tested by

no test coverage detected