Skip to content

Commit

Permalink
types: status-manager @throws annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Nov 20, 2024
1 parent b315127 commit f025034
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/fast-usdc/src/exos/status-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const prepareStatusManager = zone => {
/**
* Add a new transaction with ADVANCED status
* @param {CctpTxEvidence} evidence
* @throws {Error} if transaction was already seen
*/
advance(evidence) {
recordPendingTx(evidence, PendingTxStatus.Advanced);
Expand All @@ -115,6 +116,7 @@ export const prepareStatusManager = zone => {
/**
* Add a new transaction with OBSERVED status
* @param {CctpTxEvidence} evidence
* @throws {Error} if transaction was already seen
*/
observe(evidence) {
recordPendingTx(evidence, PendingTxStatus.Observed);
Expand All @@ -135,10 +137,15 @@ export const prepareStatusManager = zone => {
},

/**
* Mark an `ADVANCED` or `OBSERVED` transaction as `SETTLED` and remove it
* Mark an `ADVANCED` or `OBSERVED` transaction as `SETTLED` and remove
* it.
*
* If there are multiple EDU+amt matches, we are unable to know which tx
* the settlement is for, but we’ll act as if it’s the earliest one.
*
* @param {NobleAddress} address
* @param {bigint} amount
* @throws {Error} if a pending settlement was not found for the address + amount
*/
settle(address, amount) {
const key = makePendingTxKey(address, amount);
Expand Down

0 comments on commit f025034

Please sign in to comment.