diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 8237331cd..94c66a131 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -1,4 +1,4 @@ -use multiversx_sc::codec::{EncodeDefault, DecodeDefault}; +use multiversx_sc::codec::{DecodeDefault, EncodeDefault}; multiversx_sc::imports!(); multiversx_sc::derive_imports!(); @@ -52,7 +52,9 @@ impl From> for GovernanceAction } } -#[derive(TypeAbi, NestedEncode, NestedDecode, PartialEq, Debug, TopEncodeOrDefault, TopDecodeOrDefault)] +#[derive( + TypeAbi, NestedEncode, NestedDecode, PartialEq, Debug, TopEncodeOrDefault, TopDecodeOrDefault, +)] pub struct GovernanceProposal { pub proposal_id: usize, pub proposer: ManagedAddress, @@ -80,6 +82,12 @@ impl DecodeDefault for GovernanceProposal { } } +impl Default for GovernanceProposal { + fn default() -> Self { + Self::new() + } +} + impl GovernanceProposal { pub fn new() -> Self { GovernanceProposal { diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 24b3ed517..573278722 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -764,8 +764,8 @@ fn gov_propose_cancel_proposal_id_test() { gov_setup.cancel_proposal(&first_user_addr, 4).assert_ok(); - // Try to retrieve the cancelled proposal - gov_setup + // Try to retrieve the cancelled proposal + gov_setup .b_mock .execute_tx( &gov_setup.first_user.clone(), @@ -777,7 +777,6 @@ fn gov_propose_cancel_proposal_id_test() { ) .assert_ok(); - // Proposal ID = 5 let (result, proposal_id) = gov_setup.propose( &first_user_addr,