Skip to content

Commit

Permalink
chore: fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
cjkoepke committed Jan 21, 2025
1 parent e495f26 commit 2829122
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/blaze-tx/src/coinSelectors/hvfSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const recursive = (
* Inspiration taken from Lucid Evolution: https://github.com/Anastasia-Labs/lucid-evolution/blob/main/packages/lucid/src/tx-builder/internal/CompleteTxBuilder.ts#L789
* @param inputs
* @param collectedAssets
* @param preliminaryFee
* @param externalAssets
* @param coinsPerUtxoByte
* @returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
AssetId,
} from "@blaze-cardano/core";
import { createHash } from "node:crypto";
import { hvfSelector, recursive } from "../hvfSelector";
import { sortLargestFirst } from "../../utils";
import { hvfSelector, recursive } from "../../src/coinSelectors/hvfSelector";
import { sortLargestFirst } from "../../src/utils";

const sha256 = (input: string) =>
createHash("sha256").update(input).digest("hex");
Expand Down Expand Up @@ -139,16 +139,16 @@ describe("recursive", () => {
expect(program.selectedInputs).toEqual([inputs[0], inputs[2]]);
});

it.only("should throw error when no suitable inputs found", async () => {
it("should throw error when no suitable inputs found", async () => {
const inputs: TransactionUnspentOutput[] = [
createDummyUTxO(0, 7_625_851n, 32),
createDummyUTxO(1, 1_392_130n, 1),
createDummyUTxO(2, 1_120_310n, 0),
createDummyUTxO(3, 1_985_579n, 1),
createDummyUTxO(0, 7_625_851n, 32), // Min ADA: 6_120_200
];

const program = recursive(sortLargestFirst(inputs), new Value(5_000_000n));
expect(program.selectedInputs).toEqual([]);
expect(() =>
recursive(sortLargestFirst(inputs), new Value(5_000_000n)),
).toThrow(
'Your wallet does not have enough funds to cover required minimum ADA for change output: {"coins":"3494349n"}. Or it contains UTxOs with reference scripts; which are excluded from coin selection.',
);
});
});

Expand Down
1 change: 0 additions & 1 deletion packages/blaze-tx/tests/lucid.data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ test("Roundtrip data any", () => {
Data.to(datum, Data.Any() as unknown as Data),
Data.Any() as unknown as Data,
);
console.log(newDatum);
expect(datum).toEqual(newDatum);
});

Expand Down

0 comments on commit 2829122

Please sign in to comment.