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

CT types - Apply balance close account #1919

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

dssei
Copy link
Contributor

@dssei dssei commented Nov 1, 2024

Describe your changes and provide context

Testing performed to validate your change

@dssei dssei changed the title Apply balance close account CT types - Apply balance close account Nov 1, 2024
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 37.96296% with 67 lines in your changes missing coverage. Please review.

Project coverage is 61.25%. Comparing base (a9e6ad5) to head (2b091f8).
Report is 2 commits behind head on feature/ct_types.

Files with missing lines Patch % Lines
x/confidentialtransfers/types/msgs.go 7.50% 33 Missing and 4 partials ⚠️
x/confidentialtransfers/types/zk.go 55.88% 20 Missing and 10 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                  @@
##           feature/ct_types    #1919      +/-   ##
====================================================
- Coverage             61.37%   61.25%   -0.12%     
====================================================
  Files                   267      267              
  Lines                 23798    23906     +108     
====================================================
+ Hits                  14606    14644      +38     
- Misses                 8133     8190      +57     
- Partials               1059     1072      +13     
Files with missing lines Coverage Δ
x/confidentialtransfers/types/zk.go 60.29% <55.88%> (-0.89%) ⬇️
x/confidentialtransfers/types/msgs.go 46.21% <7.50%> (-16.84%) ⬇️

... and 2 files with indirect coverage changes

Copy link
Contributor

@mj850 mj850 left a comment

Choose a reason for hiding this comment

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

Approved with minor suggestions:

RE the validate suggestion, I can work on that when I merge the PRs if you think that makes sense too.

message MsgCloseAccount {
string address = 1;
string denom = 2;
CloseAccountProof proof = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call this proofs instead for consistency

}

func (c *CloseAccountProof) Validate() error {
if c.ZeroAvailableBalanceProof == nil || c.ZeroPendingBalanceLoProof == nil || c.ZeroPendingBalanceHiProof == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a thought: Should we make the validate() calls chain validate the child proofs here as well (instead of just checking for nil). Seems like it would be what the validate call should do instead of making that the responsibility of FromProto.

return nil
}

func (z *ZeroBalanceProof) ToProto(zkp *zkproofs.ZeroBalanceProof) *ZeroBalanceProof {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not actional for this PR but i'm planning to rework all the ToProto calls to make them just regular constructors NewZeroBalanceProof(zkp*zkproofs.ZeroBalanceProof) *ZeroBalanceProof instead of a instance method of z, since it doesn't actually use z.

@dssei dssei marked this pull request as ready for review November 4, 2024 23:33
@dssei dssei merged commit f68d3be into feature/ct_types Nov 4, 2024
28 of 31 checks passed
@dssei dssei deleted the apply_balance_close_account branch November 4, 2024 23:33
mj850 pushed a commit that referenced this pull request Dec 7, 2024
* pending balance type

* convert apply pending balance to a message type

* close account type
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