Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BigInt in CT Module #1966

Merged
merged 10 commits into from
Dec 3, 2024
Merged

Use BigInt in CT Module #1966

merged 10 commits into from
Dec 3, 2024

Conversation

mj850
Copy link
Contributor

@mj850 mj850 commented Nov 26, 2024

Describe your changes and provide context

We currently represent balances in the CT module as uint64s. However, it is possible that the balances exceed the limits of uint64s, especially for decrypted available balances and pending balances.

We need to use big.Ints instead of uint64 to represent balance values.

Testing performed to validate your change

Updated Unit tests and integration tests

@mj850 mj850 changed the base branch from main to feature/ct_types November 26, 2024 19:07
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 26.31579% with 56 lines in your changes missing coverage. Please review.

Project coverage is 59.96%. Comparing base (81c0d5f) to head (b0c9303).
Report is 44 commits behind head on feature/ct_types.

Files with missing lines Patch % Lines
x/confidentialtransfers/types/transfer.go 0.00% 25 Missing ⚠️
x/confidentialtransfers/types/account.go 0.00% 8 Missing ⚠️
.../confidentialtransfers/types/initialize_account.go 0.00% 8 Missing ⚠️
x/confidentialtransfers/types/withdraw.go 0.00% 8 Missing ⚠️
x/confidentialtransfers/types/msgs.go 63.63% 3 Missing and 1 partial ⚠️
...nfidentialtransfers/types/apply_pending_balance.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                  @@
##           feature/ct_types    #1966      +/-   ##
====================================================
- Coverage             61.57%   59.96%   -1.62%     
====================================================
  Files                   263      283      +20     
  Lines                 23306    25883    +2577     
====================================================
+ Hits                  14351    15520    +1169     
- Misses                 7948     9224    +1276     
- Partials               1007     1139     +132     
Files with missing lines Coverage Δ
x/confidentialtransfers/keeper/msg_server.go 73.68% <100.00%> (ø)
x/confidentialtransfers/utils/utils.go 100.00% <100.00%> (ø)
...nfidentialtransfers/types/apply_pending_balance.go 0.00% <0.00%> (ø)
x/confidentialtransfers/types/msgs.go 39.91% <63.63%> (ø)
x/confidentialtransfers/types/account.go 0.00% <0.00%> (ø)
.../confidentialtransfers/types/initialize_account.go 0.00% <0.00%> (ø)
x/confidentialtransfers/types/withdraw.go 0.00% <0.00%> (ø)
x/confidentialtransfers/types/transfer.go 0.00% <0.00%> (ø)

... and 4 files with indirect coverage changes

@mj850 mj850 merged commit ad638fd into feature/ct_types Dec 3, 2024
40 of 43 checks passed
@mj850 mj850 deleted the mj/ctBigInt branch December 3, 2024 05:46
mj850 added a commit that referenced this pull request Dec 7, 2024
* save

* backend tests passing

* test

* types test

* acl tests

* utils

* codeql

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants