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

Add a Django Form Field for Hexadecimals #291

Merged
merged 1 commit into from
Jul 18, 2022
Merged

Conversation

Uxio0
Copy link
Member

@Uxio0 Uxio0 commented Jul 6, 2022

  • Refactor Keccack256FormField inheriting the new form
  • Move form fields to a forms.py file

@coveralls
Copy link

coveralls commented Jul 6, 2022

Pull Request Test Coverage Report for Build 2650733775

  • 45 of 53 (84.91%) changed or added relevant lines in 3 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 90.812%

Changes Missing Coverage Covered Lines Changed/Added Lines %
gnosis/eth/django/filters.py 0 1 0.0%
gnosis/eth/django/models.py 4 7 57.14%
gnosis/eth/django/forms.py 41 45 91.11%
Files with Coverage Reduction New Missed Lines %
gnosis/eth/django/filters.py 5 0%
Totals Coverage Status
Change from base Build 2648523479: -0.2%
Covered Lines: 2965
Relevant Lines: 3265

💛 - Coveralls

@Uxio0 Uxio0 force-pushed the add-hex-field-form branch 2 times, most recently from c56e79a to 7609baf Compare July 11, 2022 15:42
class Keccak256Form(forms.Form):
value = Keccak256FieldForm()
value = Keccak256FieldForm(required=False)
Copy link
Member

Choose a reason for hiding this comment

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

why required=False?

Copy link
Member Author

@Uxio0 Uxio0 Jul 18, 2022

Choose a reason for hiding this comment

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

So I can test the value it gets when blank value is provided:

    form = HexForm(data={"value": ""})

@@ -140,7 +140,7 @@ class HexField(models.CharField):
On Database side a CharField is used.
"""

description = "Stores a hex value into an CharField"
description = "Stores a hex value into an CharField. DEPRECATED, use a BinaryField"
Copy link
Member

Choose a reason for hiding this comment

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

Stores a hex value into an CharField -> Stores a hex value into a CharField

- Refactor Keccack256FormField inheriting the new form
@Uxio0 Uxio0 requested a review from a team as a code owner July 18, 2022 12:44
@Uxio0 Uxio0 requested review from hectorgomezv and luarx July 18, 2022 12:44
@Uxio0 Uxio0 merged commit 37c5b70 into master Jul 18, 2022
@Uxio0 Uxio0 deleted the add-hex-field-form branch July 18, 2022 12:44
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants