Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Added a VP check that gov updated parameters are readable.
([\#4708](https://github.com/anoma/namada/pull/4708))
12 changes: 8 additions & 4 deletions crates/parameters/src/vp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,20 @@ where
};
match key_type {
KeyType::PARAMETER | KeyType::UNKNOWN_PARAMETER => {
Gov::is_proposal_accepted(&ctx.pre(), &data)?.ok_or_else(
|| {
let is_gov = Gov::is_proposal_accepted(&ctx.pre(), &data)?
.ok_or_else(|| {
Error::new_alloc(format!(
"Attempted to change a protocol parameter \
from outside of a governance proposal, or \
from a non-accepted governance proposal: \
{key}",
))
},
)
});
is_gov.and_then(|()| {
// ensure that new parameters can be decoded
let _ = crate::read(&ctx.post())?;
Ok(())
})
}
KeyType::UNKNOWN => Ok(()),
}
Expand Down
Loading