Skip to content

Commit

Permalink
fix build (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljttl3q04t authored Jul 3, 2024
1 parent 797aad5 commit c81d3ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/translucent/src/translucent/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,8 @@ export class Tx {
}
let builtTx = this.txBuilder.build(0, changeAddress).build_unchecked();

if (!(options?.witnessSet?.ignoreScriptDataHash)) {
if (options?.witnessSet?.ignoreScriptDataHash) {
} else {
const datums = C.PlutusList.new();
const unhashedData = builtTx.witness_set().plutus_data();
let hashes = [];
Expand Down
13 changes: 7 additions & 6 deletions packages/translucent/src/translucent/tx_complete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,20 @@ export class TxComplete {
return this;
}

async complete(): Promise<TxSigned> {
async complete(options?: { hasPlutusData?: boolean }): Promise<TxSigned> {
for (const task of this.tasks) {
await task();
}
const witnessSet = this.txComplete.witness_set();
const plutusData = witnessSet.plutus_data();

this.witnessSetBuilder.add_existing(witnessSet);

// FIX CML
if (plutusData && plutusData.len() > 0) {
for (let i = 0; i < plutusData.len(); i++) {
this.witnessSetBuilder.add_plutus_datum(plutusData.get(i));
if (options?.hasPlutusData) {
const plutusData = witnessSet.plutus_data();
if (plutusData && plutusData.len() > 0) {
for (let i = 0; i < plutusData.len(); i++) {
this.witnessSetBuilder.add_plutus_datum(plutusData.get(i));
}
}
}

Expand Down

0 comments on commit c81d3ec

Please sign in to comment.