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

[#257] Prevent empty transactions in transfer proposals #268

Merged
merged 2 commits into from
May 26, 2021

Conversation

rinn7e
Copy link
Contributor

@rinn7e rinn7e commented May 25, 2021

Description

Problem: Both treasuryDAO and registryDAO have proposals
that can support xtz transfers.
Both implement handle_transfer for Xtz_transfer_type in a way
that can fail: empty transactions (of unit parameter an 0 amount)
will be rejected by the network.

Solution: proposal_check now reject proposal that contains
Xtz_transfer_type with 0 mutez, add tests to cover this.

Related issue(s)

Resolves #257

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests
    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation
    • I checked whether I should update the docs and did so if necessary:

Stylistic guide (mandatory)

@rinn7e rinn7e force-pushed the rinn7e/#257-prevent-zero-tez branch from 51ebaa9 to f6d94b6 Compare May 25, 2021 13:47
@rinn7e rinn7e requested review from pasqu4le and sras May 25, 2021 14:23
Copy link
Contributor

@sras sras left a comment

Choose a reason for hiding this comment

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

LGTM

@rinn7e rinn7e force-pushed the rinn7e/#257-prevent-zero-tez branch 2 times, most recently from 801f39e to 1ead625 Compare May 26, 2021 10:58
rinn7e added 2 commits May 26, 2021 20:06
Problem: Both `treasuryDAO` and `registryDAO` have proposals
that can support xtz transfers.
Both implement `handle_transfer` for `Xtz_transfer_type` in a way
that can fail: empty transactions (of `unit` parameter an `0` amount)
will be rejected by the network.

Solution: Add an emptry transactions test to prove this.
Problem: Since empty transactions does now throw error as expect, we
need to update baseDAO to throw this error.

Solution: Update registry and treasury dao to fail proposal check when
it contains empty transactions (0 mutez xtz transfer).
@rinn7e rinn7e force-pushed the rinn7e/#257-prevent-zero-tez branch from 1ead625 to 77a0f13 Compare May 26, 2021 13:09
@rinn7e rinn7e merged commit 14c1f16 into master May 26, 2021
@rinn7e rinn7e deleted the rinn7e/#257-prevent-zero-tez branch May 26, 2021 13:14
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.

Prevent empty transactions in transfer proposals
3 participants