Skip to content

Commit 9bb7172

Browse files
Merge pull request #1555 from input-output-hk/fix/lw-11945-tx-builder-constructor-must-be-sync
fix(tx-constructor): txBuilder ctor must be sync to be used with remo…
2 parents 1e454e8 + 7772c6c commit 9bb7172

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/tx-construction/src/tx-builder/GreedyTxEvaluator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import { TxEvaluationResult, TxEvaluator } from './types';
55
* This evaluator assigns the maximum execution units per transaction to each redeemer.
66
*/
77
export class GreedyTxEvaluator implements TxEvaluator {
8-
#params: Promise<Cardano.ProtocolParameters>;
8+
#getProtocolParams: () => Promise<Cardano.ProtocolParameters>;
99

1010
/**
1111
* Creates an instance of GreedyTxEvaluator.
1212
*
1313
* @param getProtocolParams - A callback that resolves to the Cardano protocol parameters.
1414
*/
1515
constructor(getProtocolParams: () => Promise<Cardano.ProtocolParameters>) {
16-
this.#params = getProtocolParams();
16+
this.#getProtocolParams = getProtocolParams;
1717
}
1818

1919
/**
@@ -24,7 +24,7 @@ export class GreedyTxEvaluator implements TxEvaluator {
2424
* @returns A promise that resolves to the transaction evaluation result.
2525
*/
2626
async evaluate(tx: Cardano.Tx, _: Array<Cardano.Utxo>): Promise<TxEvaluationResult> {
27-
const { maxExecutionUnitsPerTransaction } = await this.#params;
27+
const { maxExecutionUnitsPerTransaction } = await this.#getProtocolParams();
2828
const { witness } = tx;
2929

3030
if (!witness || !witness.redeemers) return [];

0 commit comments

Comments
 (0)