From 2e458afa72afbf93047f4718843d6dcbf8ff62d0 Mon Sep 17 00:00:00 2001 From: brentstone Date: Fri, 30 Aug 2024 16:55:21 -0600 Subject: [PATCH] make empty data in proposal be type Default (no wasm) --- crates/governance/src/storage/proposal.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/governance/src/storage/proposal.rs b/crates/governance/src/storage/proposal.rs index 60e49c91508..c8cfd4d1464 100644 --- a/crates/governance/src/storage/proposal.rs +++ b/crates/governance/src/storage/proposal.rs @@ -96,7 +96,13 @@ impl TryFrom 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,