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

Function zerovalToTopSplit

protocol/txbuilder/template.go:724–732  ·  view source on GitHub ↗

Find any value on the stack, move it to the top, and splitzero it. Returns nil if no value is found.

(b *txvmutil.Builder, stack []stackItem)

Source from the content-addressed store, hash-verified

722// Find any value on the stack, move it to the top, and splitzero
723// it. Returns nil if no value is found.
724func zerovalToTopSplit(b *txvmutil.Builder, stack []stackItem) []stackItem {
725 stack = findAndRoll(b, stack, func(_ int, item stackItem) bool {
726 return len(item.anchor) != 0
727 })
728 if stack != nil {
729 return split(b, stack, 0)
730 }
731 return nil
732}
733
734// Find a zero value on the stack, move it to the top
735func zerovalToTop(b *txvmutil.Builder, stack []stackItem) []stackItem {

Callers 1

materializeTxMethod · 0.85

Calls 2

findAndRollFunction · 0.85
splitFunction · 0.85

Tested by

no test coverage detected