Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
✅ Add ccmHandler unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ishantiw committed Mar 7, 2024
1 parent 56cc560 commit 7126fdf
Show file tree
Hide file tree
Showing 2 changed files with 1,006 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class CCUHandler {
);
if (!validatorsDataAtNewCertificate) {
throw new Error(
`No validators data at new certificate with hash at ${this._lastCertificate.validatorsHash.toString(
`No validators data at new certificate with hash at ${newCertificate.validatorsHash.toString(
'hex',
)}`,
);
Expand Down Expand Up @@ -275,7 +275,7 @@ export class CCUHandler {
lastSentCCUTxID: string,
): Promise<string | undefined> {
if (!this._db.privateKey) {
throw new Error('There is no key enabled to submit CCU');
throw new Error('There is no key enabled to submit CCU.');
}
const relayerPublicKey = cryptography.ed.getPublicKeyFromPrivateKey(this._db.privateKey);
const targetCommand = this._isReceivingChainMainchain
Expand Down Expand Up @@ -350,7 +350,7 @@ export class CCUHandler {
return getNextCertificateFromAggregateCommits(this._db, bftHeights, this._lastCertificate);
}

public async _getCcuFee(tx: Record<string, unknown>): Promise<bigint> {
private async _getCcuFee(tx: Record<string, unknown>): Promise<bigint> {
let additionalFee = BigInt(0);

const userBalance = await this._receivingChainAPIClient.hasUserTokenAccount(
Expand Down
Loading

0 comments on commit 7126fdf

Please sign in to comment.