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

Function zerovalToTop

protocol/txbuilder/template.go:735–739  ·  view source on GitHub ↗

Find a zero value on the stack, move it to the top

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

Source from the content-addressed store, hash-verified

733
734// Find a zero value on the stack, move it to the top
735func zerovalToTop(b *txvmutil.Builder, stack []stackItem) []stackItem {
736 return findAndRoll(b, stack, func(_ int, item stackItem) bool {
737 return len(item.anchor) != 0 && item.amount == 0
738 })
739}
740
741func valueToTop(b *txvmutil.Builder, stack []stackItem, amount int64, assetID bc.Hash) ([]stackItem, error) {
742 if len(stack) == 0 {

Callers 1

materializeTxMethod · 0.85

Calls 1

findAndRollFunction · 0.85

Tested by

no test coverage detected