View Source BitcoinLib.Script.Opcodes.Arithmetic.OneAdd (BitcoinLib v0.4.7)

Based on https://en.bitcoin.it/wiki/Script

Word OP_1ADD Opcode 139 Hex 0x8b Input in Output out 1 is added to the input.

Link to this section Summary

Functions

Returns <<0x8b>>

b is subtracted from a.

v()

Returns 0x8b

Link to this section Types

@type t() :: BitcoinLib.Script.Opcodes.Arithmetic.OneAdd

Link to this section Functions

@spec encode() :: <<_::8>>

Returns <<0x8b>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.Arithmetic.OneAdd.encode()
<<0x8b>>
@spec execute(t(), list()) :: {:ok, list()}

b is subtracted from a.

examples

Examples

iex> BitcoinLib.Script.Opcodes.Arithmetic.OneAdd.execute(
...>  %BitcoinLib.Script.Opcodes.Arithmetic.OneAdd{},
...>  [7, 3, 1]
...> )
{:ok, [8, 3, 1]}
@spec v() :: 139

Returns 0x8b

examples

Examples

iex> BitcoinLib.Script.Opcodes.Arithmetic.OneAdd.v()
0x8b