MCPcopy
hub / github.com/btcsuite/btcd / PopInt

Method PopInt

txscript/stack.go:83–90  ·  view source on GitHub ↗

PopInt pops the value off the top of the stack, converts it into a script num, and returns it. The act of converting to a script num enforces the consensus rules imposed on data interpreted as numbers. Stack transformation: [... x1 x2 x3] -> [... x1 x2]

()

Source from the content-addressed store, hash-verified

81//
82// Stack transformation: [... x1 x2 x3] -> [... x1 x2]
83func (s *stack) PopInt() (scriptNum, error) {
84 so, err := s.PopByteArray()
85 if err != nil {
86 return 0, err
87 }
88
89 return MakeScriptNum(so, s.verifyMinimalData, maxScriptNumLen)
90}
91
92// PopBool pops the value off the top of the stack, converts it into a bool, and
93// returns it.

Callers 15

TestStackFunction · 0.95
opcodePickFunction · 0.80
opcodeRollFunction · 0.80
opcode1AddFunction · 0.80
opcode1SubFunction · 0.80
opcodeNegateFunction · 0.80
opcodeAbsFunction · 0.80
opcodeNotFunction · 0.80
opcode0NotEqualFunction · 0.80
opcodeAddFunction · 0.80
opcodeSubFunction · 0.80
opcodeBoolAndFunction · 0.80

Calls 2

PopByteArrayMethod · 0.95
MakeScriptNumFunction · 0.85

Tested by 1

TestStackFunction · 0.76