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
2 changes: 1 addition & 1 deletion contracts/predictify-hybrid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pub mod gov_registry;
mod fees;
mod gas;
mod governance;
mod delegation;
mod markets;
mod monitoring;
mod oracles;
Expand Down Expand Up @@ -71,6 +70,7 @@ mod utils;
mod validation;
mod versioning;
mod voting;
mod voting_delegation;
mod voting_delegation_integration;
mod market_analytics;
mod performance_benchmarks;
Expand Down
28 changes: 28 additions & 0 deletions contracts/predictify-hybrid/src/voting_delegation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//! Delegation-aware voting helpers.
//!
//! This module keeps delegation-specific voting logic separated from the core
//! voting mechanics defined in [`crate::voting`]. It re-exports the shared
//! integration implementation so both the historical path and the dedicated
//! delegation module remain available.

pub use crate::voting_delegation_integration::{VotingAuthority, VotingIntegration};

#[cfg(test)]
mod tests {
use super::*;
use soroban_sdk::{testutils::Address as _, Address, Env};

#[test]
fn test_voting_integration_is_available_from_delegation_module() {
let env = Env::default();
let user = Address::generate(&env);
let contract_id = env.register(crate::PredictifyHybrid, ());

env.as_contract(&contract_id, || {
let authority = VotingIntegration::resolve_voting_authority(&env, &user).unwrap();
assert_eq!(authority.vote_owner, user);
assert_eq!(authority.executing_authority, user);
assert!(!authority.is_delegated);
});
}
}
Loading