Skip to content

Commit

Permalink
fixup! fix(nami): init collateral explicitly checks available utxos
Browse files Browse the repository at this point in the history
  • Loading branch information
mchappell committed Oct 29, 2024
1 parent 5d1e9bc commit 2defe29
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/nami/src/adapters/collateral.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ describe('useCollateral', () => {
const unspendable$ = of({
coins: BigInt(4999),
});
mockWithSignTxConfirmation.mockImplementation(
async (mockSubmitCollateralTx, password) => {
await mockSubmitCollateralTx();
},
);

const { result } = renderHook(() =>
useCollateral({
inMemoryWallet: {
Expand All @@ -132,10 +138,12 @@ describe('useCollateral', () => {
await result.current.submitCollateral(password);

expect(mockWithSignTxConfirmation).toBeCalledWith(
mockSubmitCollateralTx,
expect.any(Function),
password,
);

expect(mockWithSignTxConfirmation).toBeCalledTimes(1);
expect(mockSubmitCollateralTx).toBeCalledTimes(1);
});

describe('getCollateralUtxo', () => {
Expand Down

0 comments on commit 2defe29

Please sign in to comment.