seedelf_cli::data_structures

Function create_spend_redeemer

Source
pub fn create_spend_redeemer(z: String, g_r: String, pkh: String) -> Vec<u8> 
Expand description

Creates a spend redeemer for a Plutus script.

This function takes three hex-encoded strings (z, g_r, pkh), converts them to byte vectors, and constructs a PlutusData structure with a custom Constr type (tag 121). The resulting data is serialized as a fragment.

§Arguments

  • z - A hex-encoded string representing the first field.
  • g_r - A hex-encoded string representing the second field.
  • pkh - A hex-encoded string representing the third field.

§Returns

  • Vec<u8> - The encoded PlutusData fragment as a byte vector.

§Panics

  • If any input string cannot be converted into a valid hex string.