Function output_null_datum

Source
pub fn output_null_datum(
    a: u32,
    b: u32,
) -> Option<Option<Either<(u2, u256), Either<u1, u4>>>>
Expand description

Return the b-th entry of a null data (OP_RETURN) output at index a.

  • Return Some(Some(Right(Right(x-1)))) if the entry is OP_x for x in the range 1..=16.
  • Return Some(Some(Right(Left(0)))) if the entry is OP_1NEGATE.
  • Return Some(Some(Right(Left(1)))) if the entry is OP_RESERVED.
  • Return Some(Some(Left((x, hash)))) if the entry is pushed data. hash is the SHA256 hash of the data pushed and x indicates how the data was pushed:
    • x == 0 means the push was an immediate 0 to 75 bytes.
    • x == 1 means the push was an OP_PUSHDATA1.
    • x == 2 means the push was an OP_PUSHDATA2.
    • x == 3 means the push was an OP_PUSHDATA4.
  • Return Some(None) if the null data has fewer than b entries.
  • Return None if the output is not a null data output.

Use this jet to read peg-out data from an output.

ยงCost

87 mWU (milli weight units)