Skip to content

Commit

Permalink
make empty data in proposal be type Default (no wasm)
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Aug 30, 2024
1 parent 60d3d17 commit 2e458af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/governance/src/storage/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ impl TryFrom<DefaultProposal> for InitProposalData {
content: Hash::default(),
author: value.proposal.author,
r#type: match value.data {
Some(_) => ProposalType::DefaultWithWasm(Hash::default()),
Some(bytes) => {
if bytes.is_empty() {
ProposalType::Default
} else {
ProposalType::DefaultWithWasm(Hash::default())
}
}
None => ProposalType::Default,
},
voting_start_epoch: value.proposal.voting_start_epoch,
Expand Down

0 comments on commit 2e458af

Please sign in to comment.