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

update transfer error messages #7968

Merged
merged 2 commits into from
Nov 18, 2020
Merged

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Nov 18, 2020

Description

changes inspired by:

refundPacketToken spec does not return errors, but there are fallible operations in the code (ie. SendCoins and MintCoins). If we cannot 'mint vouchers back to sender' there is a problem. Either the code should clarify/assert that errors are not possible, or errors should be handled somehow more severely.

and discussion with @AdityaSripal

ref: #7736


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@colin-axner colin-axner changed the title update transfer err messages update transfer error messages Nov 18, 2020
Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Would like review from @cwgoes as well to make sure we never panic when we shouldn't

// counterparty module. The bug may occur in bank or any part of the code that allows
// the escrow address to be drained. A malicious counterparty module could drain the
// escrow address by allowing more tokens to be sent back then were escrowed.
return sdkerrors.Wrap(err, "unable to unescrow tokens, this may be caused by a malicious counterparty module or a bug: please open an issue")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return sdkerrors.Wrap(err, "unable to unescrow tokens, this may be caused by a malicious counterparty module or a bug: please open an issue")
return sdkerrors.Wrap(err, "unable to unescrow tokens, this may be caused by a malicious counterparty module or a bug: please open an issue on counterparty module")

Don't necessarily want this going to SDK first, since first check is bug in the module/malicous party

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to both error messages

@codecov
Copy link

codecov bot commented Nov 18, 2020

Codecov Report

Merging #7968 (6e187ed) into master (1cc8af8) will decrease coverage by 0.00%.
The diff coverage is 55.55%.

@@            Coverage Diff             @@
##           master    #7968      +/-   ##
==========================================
- Coverage   54.17%   54.17%   -0.01%     
==========================================
  Files         612      612              
  Lines       39047    39051       +4     
==========================================
+ Hits        21153    21155       +2     
- Misses      15719    15720       +1     
- Partials     2175     2176       +1     

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

ACK - all of these look correct to me

@fedekunze fedekunze merged commit f02a462 into master Nov 18, 2020
@fedekunze fedekunze deleted the colin/7736-transfer-err-msgs branch November 18, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants