cardano-serialization-lib icon indicating copy to clipboard operation
cardano-serialization-lib copied to clipboard

OutputDatum is not used in TransactionOutput

Open klntsky opened this issue 1 year ago • 1 comments

Looks like these two functions could have been combined into one that returns an optional OutputDatum:

declare export class TransactionOutput {
  ...
  /**
   * @returns {DataHash | void}
   */
  data_hash(): DataHash | void;

  /**
   * @returns {PlutusData | void}
   */
  plutus_data(): PlutusData | void;

OutputDatum definition for context:

declare export class OutputDatum {
  free(): void;

  /**
   * @param {DataHash} data_hash
   * @returns {OutputDatum}
   */
  static new_data_hash(data_hash: DataHash): OutputDatum;

  /**
   * @param {PlutusData} data
   * @returns {OutputDatum}
   */
  static new_data(data: PlutusData): OutputDatum;

  /**
   * @returns {DataHash | void}
   */
  data_hash(): DataHash | void;

  /**
   * @returns {PlutusData | void}
   */
  data(): PlutusData | void;
}

klntsky avatar Jan 22 '24 19:01 klntsky