Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('handleFeeAndChange', () => {
testContext,
),
).toThrow(
`Insufficient funds: provided UTXOs need 4 more nAVAX (asset id: ${testContext.avaxAssetID})`,
`Insufficient funds: provided UTXOs need 4 more unlocked nAVAX (asset id: ${testContext.avaxAssetID}) to cover fee.`,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ const canPayFeeAndNeedsChange = (
context: Context,
): boolean => {
// Not enough funds to pay the fee.
// NOTE: Time locked UTXOs can not be used to pay fees.
if (excessAVAX < requiredFee) {
throw new Error(
`Insufficient funds: provided UTXOs need ${
requiredFee - excessAVAX
} more nAVAX (asset id: ${context.avaxAssetID})`,
} more unlocked nAVAX (asset id: ${context.avaxAssetID}) to cover fee.`,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export const getUsableUTXOsFilter =
return true;
};

/**
* Reducer function that is responsible for spending UTXOs that are locked and stakeable.
*
* NOTE: Time locked UTXOs can not be used to pay fees.
*/
export const useSpendableLockedUTXOs: SpendReducerFunction = (
state,
spendHelper,
Expand Down
Loading