Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutputDatum is not used in TransactionOutput #661

Open
klntsky opened this issue Jan 22, 2024 · 1 comment
Open

OutputDatum is not used in TransactionOutput #661

klntsky opened this issue Jan 22, 2024 · 1 comment

Comments

@klntsky
Copy link

klntsky commented Jan 22, 2024

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;
}
@lisicky
Copy link
Contributor

lisicky commented Jan 25, 2024

Hi @klntsky ! It's good point but it leads API breaking changes, we might consider it but it's not priority now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants