lib/bitcoin/script.rb
# Adds the opcode corresponding to the given number. Returns self.
Adds the opcode corresponding to the given number. Returns self.
Adds the opcode corresponding to the given number . Returns self .
def append_number(number)
    opcode =
      case number
      when -1 then OP_1NEGATE
      when 0 then OP_0
      when 1 then OP_1
      when 2..16 then OP_2 + (16 - number)
      end
    raise "No opcode for number #{number}" if opcode.nil?
    append_opcode(opcode)
  end
def append_number ( number ) opcode = case number when - 1 then OP_1NEGATE when 0 then OP_0 when 1 then OP_1 when 2 .. 16 then OP_2 + ( 16 - number ) end raise "No opcode for number #{number}" if opcode . nil? append_opcode ( opcode ) end
Adds the opcode corresponding to the given number.
Adds the opcode corresponding to the given number .
number
<not_specific>