From bd3c0c1932dc61ae15a3d853b31b8d7df4806547 Mon Sep 17 00:00:00 2001 From: Mahmoud-Emad Date: Wed, 21 May 2025 11:26:13 +0300 Subject: [PATCH] fix: Support passing the proposal status --- .../examples/governance_proposal_example/main.rs | 10 ++++++---- heromodels/examples/governance_rhai/example.rs | 4 ++++ heromodels/src/models/governance/proposal.rs | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/heromodels/examples/governance_proposal_example/main.rs b/heromodels/examples/governance_proposal_example/main.rs index 9d790f9..13c2f69 100644 --- a/heromodels/examples/governance_proposal_example/main.rs +++ b/heromodels/examples/governance_proposal_example/main.rs @@ -18,10 +18,11 @@ fn main() { "Ahmed fared", // creator_id "Community Fund Allocation for Q3", // title "Proposal to allocate funds for community projects in the third quarter.", // description - Utc::now(), // created_at - Utc::now(), // updated_at - Utc::now(), // vote_start_date - Utc::now() + Duration::days(14), // vote_end_date (14 days from now) + ProposalStatus::Draft, + Utc::now(), // created_at + Utc::now(), // updated_at + Utc::now(), // vote_start_date + Utc::now() + Duration::days(14), // vote_end_date (14 days from now) ); println!( @@ -131,6 +132,7 @@ fn main() { "Wael Ghonem", "Internal Team Restructure Vote", "Vote on proposed internal team changes.", + ProposalStatus::Draft, Utc::now(), Utc::now(), Utc::now(), diff --git a/heromodels/examples/governance_rhai/example.rs b/heromodels/examples/governance_rhai/example.rs index 0b1ba14..9ee4394 100644 --- a/heromodels/examples/governance_rhai/example.rs +++ b/heromodels/examples/governance_rhai/example.rs @@ -38,6 +38,7 @@ fn main() -> Result<(), Box> { creator_name, title, description, + ProposalStatus::Draft, Utc::now(), Utc::now(), start_date, @@ -158,6 +159,7 @@ fn main() -> Result<(), Box> { "Retrieved Creator Name", "Retrieved Proposal", "Retrieved Description", + ProposalStatus::Draft, Utc::now(), Utc::now(), start_date, @@ -184,6 +186,7 @@ fn main() -> Result<(), Box> { "Creator Name 1", "Proposal 1", "Description 1", + ProposalStatus::Draft, Utc::now(), Utc::now(), start_date, @@ -195,6 +198,7 @@ fn main() -> Result<(), Box> { "Creator Name 2", "Proposal 2", "Description 2", + ProposalStatus::Draft, Utc::now(), Utc::now(), start_date, diff --git a/heromodels/src/models/governance/proposal.rs b/heromodels/src/models/governance/proposal.rs index 3ab0647..57eaa56 100644 --- a/heromodels/src/models/governance/proposal.rs +++ b/heromodels/src/models/governance/proposal.rs @@ -137,6 +137,7 @@ impl Proposal { creator_name: impl ToString, title: impl ToString, description: impl ToString, + status: ProposalStatus, created_at: DateTime, updated_at: DateTime, vote_start_date: DateTime, @@ -153,7 +154,7 @@ impl Proposal { creator_name: creator_name.to_string(), title: title.to_string(), description: description.to_string(), - status: ProposalStatus::Draft, + status, created_at, updated_at, vote_start_date,