MCPcopy Create free account
hub / github.com/DNAProject/DNA / PushNum

Method PushNum

core/program/program.go:50–59  ·  view source on GitHub ↗
(num uint16)

Source from the content-addressed store, hash-verified

48}
49
50func (self *ProgramBuilder) PushNum(num uint16) *ProgramBuilder {
51 if num == 0 {
52 return self.PushOpCode(neovm.PUSH0)
53 } else if num <= 16 {
54 return self.PushOpCode(neovm.OpCode(uint8(num) - 1 + uint8(neovm.PUSH1)))
55 }
56
57 bint := big.NewInt(int64(num))
58 return self.PushBytes(common.BigIntToNeoBytes(bint))
59}
60
61func (self *ProgramBuilder) PushBytes(data []byte) *ProgramBuilder {
62 if len(data) == 0 {

Callers 2

Calls 4

PushOpCodeMethod · 0.95
PushBytesMethod · 0.95
OpCodeTypeAlias · 0.92
BigIntToNeoBytesFunction · 0.92

Tested by 1