Skip to content

Commit

Permalink
Fix accountOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
gregLibert committed Apr 30, 2024
1 parent 4821931 commit b03d26e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/massa-web3/src/experimental/accountOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class AccountOperation {
if (type !== OperationType.RollBuy && type !== OperationType.RollSell) {
throw new Error('Invalid roll operation type.')
}
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
if (amount <= 0) {
throw new Error('amount of rolls must be a positive non-zero value.')
}
Expand Down Expand Up @@ -86,6 +87,7 @@ export class AccountOperation {
amount: bigint,
opts?: OptOpDetails
): Promise<Operation> {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
if (amount <= 0) {
throw new Error('amount to trasnfer must be a positive non-zero value.')
}
Expand Down Expand Up @@ -116,7 +118,7 @@ export class AccountOperation {
*
* @returns The balance of the account.
*/
async fetchBalance(final: boolean = true): Promise<bigint> {
async fetchBalance(final = true): Promise<bigint> {
return this.client.getBalance(this.account.address.toString(), final)
}
}

1 comment on commit b03d26e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report for experimental massa-web3

St.
Category Percentage Covered / Total
🔴 Statements 40.41% 780/1930
🔴 Branches 17.96% 88/490
🔴 Functions 30.95% 117/378
🔴 Lines 40.17% 766/1907

Test suite run success

47 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from b03d26e

Please sign in to comment.