-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor!: manual payout only #68
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
==========================================
+ Coverage 72.31% 72.94% +0.63%
==========================================
Files 33 31 -2
Lines 1795 1678 -117
==========================================
- Hits 1298 1224 -74
+ Misses 432 403 -29
+ Partials 65 51 -14 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Reecepbcups, this is awesome!
Some small comments and nit, nothing major.
return fmt.Errorf("invalid payout: %v for address: %s", p, addr) | ||
} | ||
|
||
if err := k.mintCoinsToAccount(ctx, sdkAddr, coin); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I correct to believe this function still allows partial minting if an error occurs in a later iteration?
Can we mitigate this by performing all the address and coin checks first?
The operation can still fail for insert reason in the SDK. Is there a way to avoid partial minting at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial minting is not possible in the SDK. Either everything in the Tx is successful for none of it is. Atomnic Txs are not yet in the SDK. maybe SDK v0.52
}, | ||
{ | ||
desc: "duplicate address", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep this check and test. Duplicate addresses should be avoided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added duplicate test to validate (CLI) and in the MsgServer. Also added to e2e to validate it's deterministic (i.e. reason I did not use a map given the last issue we had, I still need to look more into)
if c.shouldFail { | ||
require.Error(t, err) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check the balances on failure to see if we didn't perform partial minting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref: partial minting is not possible in the SDK - #68 (comment)
closes #56
closes #27
Summary
TODO
make local-image
andmake local-image-cov
is confusing. We should just use -cov only and have it namedlocal-image