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

Function bury

protocol/txbuilder/template.go:675–684  ·  view source on GitHub ↗
(b *txvmutil.Builder, stack []stackItem, n int)

Source from the content-addressed store, hash-verified

673}
674
675func bury(b *txvmutil.Builder, stack []stackItem, n int) []stackItem {
676 b.PushdataInt64(int64(n)) // <n>
677 b.Op(op.Bury) // bury
678 item, stack := stack[len(stack)-1], stack[:len(stack)-1]
679 before, after := stack[:len(stack)-n], stack[len(stack)-n:]
680 stack = append([]stackItem{}, before...)
681 stack = append(stack, item)
682 stack = append(stack, after...)
683 return stack
684}
685
686func split(b *txvmutil.Builder, stack []stackItem, amount int64) []stackItem {
687 b.PushdataInt64(amount) // <amount>

Callers 1

mergeFunction · 0.85

Calls 2

OpMethod · 0.80
PushdataInt64Method · 0.45

Tested by

no test coverage detected