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

Check for negative amounts in the token methods #8559

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

mosmartin
Copy link
Contributor

What was the problem?

This PR resolves #8470

How was it solved?

Added -ve amount checks

How was it tested?

Added unit tests. npm t token/method

@mosmartin mosmartin requested review from shuse2 and bobanm June 6, 2023 15:14
@mosmartin mosmartin self-assigned this Jun 6, 2023
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #8559 (2a010c6) into release/6.0.0 (ba05905) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 2a010c6 differs from pull request most recent head e7e6724. Consider uploading reports for the commit e7e6724 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff               @@
##           release/6.0.0    #8559   +/-   ##
==============================================
  Coverage          83.31%   83.31%           
==============================================
  Files                593      593           
  Lines              22296    22300    +4     
  Branches            3277     3279    +2     
==============================================
+ Hits               18575    18579    +4     
  Misses              3721     3721           
Impacted Files Coverage Δ
framework/src/modules/token/method.ts 96.79% <100.00%> (+0.04%) ⬆️

Copy link
Contributor

@bobanm bobanm left a comment

Choose a reason for hiding this comment

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

Looks good. Just one comment. Some test cases check only for negative amounts, while some others test both for negative and zero. That is not consistent, but also might be redundant.

I think it is enough to test that the amount is negative, as it is handled in the tested methods by the same conditional:

if (amount <= BigInt(0))

@mosmartin mosmartin requested review from ishantiw and shuse2 and removed request for shuse2 and ishantiw June 8, 2023 14:55
@shuse2 shuse2 enabled auto-merge (squash) June 12, 2023 01:07
@shuse2 shuse2 disabled auto-merge June 12, 2023 01:08
@shuse2 shuse2 enabled auto-merge (squash) June 12, 2023 01:08
@shuse2 shuse2 merged commit fe67ea1 into release/6.0.0 Jun 12, 2023
@shuse2 shuse2 deleted the 8470-negative-amount-checks-token-methods branch June 12, 2023 01:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants