pgf/governance disallow non-native transfers#4667
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4667 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@cwgoes we should always allow credit to pgf and governance addresses right? |
Anyone should always be allowed to send tokens TO these addresses, yes. @Fraccaman |
crates/governance/src/vp/mod.rs
Outdated
| && checked!(post_balance - pre_balance)? >= min_funds_parameter | ||
| let is_valid_balance = if is_proposal { | ||
| if !native_token_address.eq(token) { | ||
| return Err(Error::new_alloc( |
There was a problem hiding this comment.
I think I've missed this in my first review, this can be new_const too
sug0
left a comment
There was a problem hiding this comment.
I think the code might be fine now, but if possible here are some tests that would be nice to have:
- making sure the pgf/gov balance can decrease/increase with governance proposals (with native or non-native tokens)
- making sure the pgf/gov balance can increase (with native or non-native tokens)
- making sure the pgf/gov balance cannot decrease (with native or non-native tokens)
only a subset of these tests is implemented. it should be relatively easy to impl them, should be a copy/paste of some test and changing a few things
|
@sug0 let's leave the remaining tests for another PR. We need to merge this and cut a release ASAP to at least start testing on Housefire |
We have an e2e test that does this with IBC
I think i've added
Same here with Native token credit is also tested by e2e test and unit test where we check that a proposal was initialized correctly (the proposal author has to deposit some nam). Maybe I can add a test for native token debit. |
Will impl remaining tests later. Need merged now
Describe your changes
Checklist before merging
breaking::labelsnamada-docsreponamada-indexerornamada-masp-indexer, a corresponding PR is opened in that repo