Skip to content

Commit

Permalink
feat: adding verbose in meshtxbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Aug 24, 2024
1 parent b803b08 commit 423b1ac
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
19 changes: 15 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/mesh-common/src/interfaces/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from "../types";

export interface IMeshTxSerializer {
verbose: boolean;
serializeTxBody(
txBuilderBody: MeshTxBuilderBody,
protocolParams: Protocol,
Expand Down
4 changes: 3 additions & 1 deletion packages/mesh-core-cst/src/serializer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import { hashScriptData } from "../utils/script-data-hash";
import { empty, mergeValue, negatives, subValue } from "../utils/value";

export class CardanoSDKSerializer implements IMeshTxSerializer {
verbose: boolean;
private txBody: TransactionBody;
private txWitnessSet: TransactionWitnessSet;

Expand All @@ -87,7 +88,8 @@ export class CardanoSDKSerializer implements IMeshTxSerializer {
[2]: false,
};

constructor() {
constructor(verbose = false) {
this.verbose = verbose;
this.txBody = new TransactionBody(
Serialization.CborSet.fromCore([], TransactionInput.fromCore),
[],
Expand Down
3 changes: 2 additions & 1 deletion packages/mesh-transaction/src/mesh-tx-builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ export class MeshTxBuilder extends MeshTxBuilderCore {
this.serializer = serializer;
} else {
// this.serializer = new CardanoSDKSerializer();
this.serializer = new CSLSerializer(); // add verbose in here
this.serializer = new CSLSerializer();
}
this.serializer.verbose = verbose;
if (fetcher) this.fetcher = fetcher;
if (submitter) this.submitter = submitter;
if (evaluator) this.evaluator = evaluator;
Expand Down

0 comments on commit 423b1ac

Please sign in to comment.