Skip to content

Commit

Permalink
Improve docs in the Ethereum Bridge implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
r-czajkowski committed Jun 20, 2023
1 parent 97d3c65 commit dee7020
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions typescript/src/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,10 @@ export class Bridge
})
}

// eslint-disable-next-line valid-jsdoc
/**
* @see {ChainBridge#wallets}
*/
async wallets(walletPublicKeyHash: string): Promise<Wallet> {
const wallet = await backoffRetrier<Wallets.WalletStructOutput>(
this._totalRetryAttempts
Expand All @@ -708,6 +712,11 @@ export class Bridge
return this.parseWalletDetails(wallet)
}

/**
* Parses a wallet data using data fetched from the on-chain contract.
* @param wallet Data of the wallet.
* @returns Parsed wallet data.
*/
private async parseWalletDetails(
wallet: Wallets.WalletStructOutput
): Promise<Wallet> {
Expand All @@ -730,11 +739,12 @@ export class Bridge
}
}

// eslint-disable-next-line valid-jsdoc
/**
* Builds the UTXO hash based on the UTXO components. UTXO hash is computed as
* `keccak256(txHash | txOutputIndex | txOutputValue)`.
* @param utxo UTXO components.
* @returns The hash of the UTXO.
*
* @see {ChainBridge#buildUTXOHash}
*/
buildUTXOHash(utxo: UnspentTransactionOutput): Hex {
return Hex.from(
Expand Down

0 comments on commit dee7020

Please sign in to comment.