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

feat: Adjust SignatureError with helpful tip on including sender= tx kwarg #1826

Merged
merged 6 commits into from
Jan 8, 2024

Conversation

miohtama
Copy link
Contributor

@miohtama miohtama commented Jan 8, 2024

What I did

A developer experience enhancement.

When doing a transaction with Ape, if you forget sender parameter you get an unhelpful error message.

Adding a help tip for SignatureError error message to hint to the user what's probably wrong:

            raise SignatureError("The transaction is not signed. Did you forget to add sender argument to the transaction function call?")

How I did it

Better error message.

How to verify it

Checklist

  • All changes are completed
  • [-] New test cases have been added (no functional changes)
  • Documentation has been updated (no functional changes)

@miohtama miohtama changed the title Add help tip to SignatureError Feat: Add help tip to SignatureError Jan 8, 2024
Copy link
Member

@antazoey antazoey left a comment

Choose a reason for hiding this comment

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

To lessen the chance of providing wrong information, we could conditionally append the new suffix if and only if self.sender is falsey

src/ape_ethereum/transactions.py Outdated Show resolved Hide resolved
antazoey
antazoey previously approved these changes Jan 8, 2024
Copy link
Member

@antazoey antazoey left a comment

Choose a reason for hiding this comment

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

@miohtama what do you think of the commit I added?

@antazoey antazoey changed the title Feat: Add help tip to SignatureError feat: Adjust SignatureError with helpful tip on including sender= tx kwarg Jan 8, 2024
Copy link
Member

@fubuloubu fubuloubu 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 modification that @antazoey added

@antazoey antazoey enabled auto-merge (squash) January 8, 2024 19:27
@antazoey antazoey merged commit a0354ca into ApeWorX:main Jan 8, 2024
15 checks passed
antazoey added a commit to antazoey/ape that referenced this pull request Jan 8, 2024
… tx kwarg (ApeWorX#1826)

Co-authored-by: Juliya Smith <jules@apeworx.io>
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.

3 participants