View Source BitcoinLib.Script.Opcodes.Constants.PushData1 (BitcoinLib v0.4.7)

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

Word OP_PUSHDATA1 Opcode 76 Hex 0x4c Input (special) Output data The next byte contains the number of bytes to be pushed onto the stack.

Link to this section Summary

Functions

Returns <<>>

The next byte contains the number of bytes to be pushed onto the stack.

v()

Returns 0x4c

Link to this section Types

@type t() :: BitcoinLib.Script.Opcodes.Constants.PushData1

Link to this section Functions

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

Returns <<>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.Constants.PushData1.encode()
<<0x4c>>
Link to this function

execute(push_data1, remaining)

View Source
@spec execute(t(), list()) :: {:ok, list()} | {:error, binary()}

The next byte contains the number of bytes to be pushed onto the stack.

examples

Examples

iex> BitcoinLib.Script.Opcodes.Constants.PushData1.execute(
...>  %BitcoinLib.Script.Opcodes.Constants.PushData1{value: <<3, 4, 2, 1>>},
...>  [3]
...> )
{:ok, [<<4, 2, 1>> | [3]]}
@spec v() :: 76

Returns 0x4c

examples

Examples

iex> BitcoinLib.Script.Opcodes.Constants.PushData1.v()
0x4c