mod build;
#[cfg(feature = "nns-host")]
pub(super) mod collection;
mod error;
mod model;
mod request;
mod source;
mod text;
mod validation;
#[cfg(any(feature = "nns-host", feature = "canister"))]
mod wire;
#[cfg(feature = "nns-host")]
pub use build::{
build_nns_governance_economics_report, build_nns_governance_maturity_modulation_report,
build_nns_governance_metrics_report, build_nns_governance_reward_event_report,
};
pub use build::{
build_nns_governance_economics_report_with_source,
build_nns_governance_maturity_modulation_report_with_source,
build_nns_governance_metrics_report_with_source,
build_nns_governance_reward_event_report_with_source,
};
#[cfg(feature = "nns-host")]
pub use collection::NnsGovernanceRefreshReport;
#[cfg(feature = "nns-host")]
pub(super) use collection::{
NnsGovernanceAttemptReadError, NnsGovernanceCacheMetadata,
read_governance_refresh_attempt_status, run_governance_snapshot_refresh,
validate_governance_cache_metadata, write_running_governance_refresh_attempt,
};
pub use error::NnsGovernanceError;
pub use model::{
NnsGovernanceCollectionStatus, NnsGovernanceDecimal, NnsGovernanceEconomics,
NnsGovernanceEconomicsReport, NnsGovernanceExecutionAssurance, NnsGovernanceMaturityModulation,
NnsGovernanceMaturityModulationReport, NnsGovernanceMetricBucket, NnsGovernanceMetrics,
NnsGovernanceMetricsReport, NnsGovernanceNeuronSubsetMetrics, NnsGovernancePercentage,
NnsGovernanceProposalId, NnsGovernanceReportContext, NnsGovernanceRewardEvent,
NnsGovernanceRewardEventReport, NnsGovernanceSourceProvenance, NnsGovernanceVote,
NnsNeuronsFundEconomics, NnsNeuronsFundMatchedFundingCurveCoefficients,
NnsVotingPowerEconomics,
};
pub(in crate::nns) use model::{
deserialize_code_label, native_code_classification, native_optional_code_classification,
};
pub use request::{NnsGovernanceRequest, NnsGovernanceSourceSelection};
#[cfg(all(feature = "canister", target_arch = "wasm32"))]
pub use source::CanisterNnsSource;
#[cfg(all(feature = "canister", target_arch = "wasm32"))]
pub(crate) use source::canister::{call_with_arg, canister_provenance};
#[cfg(feature = "nns-host")]
pub(crate) use source::host::host_request;
pub use source::{NnsGovernanceSource, NnsGovernanceSourceData, NnsGovernanceSourceFuture};
#[cfg(feature = "nns-host")]
pub use text::nns_governance_refresh_report_text;
pub(crate) use text::{
context_lines as governance_context_lines, source_lines as governance_source_lines,
};
pub use text::{
nns_governance_economics_report_text, nns_governance_maturity_modulation_report_text,
nns_governance_metrics_report_text, nns_governance_reward_event_report_text,
};
#[cfg(feature = "nns-host")]
pub(crate) use validation::enforce_mainnet_network as enforce_governance_mainnet_network;
pub(crate) use validation::{
validate_governance_collection_identity, validate_governance_collection_page_bounds,
validate_governance_continuation_request, validate_governance_report_source,
validate_governance_request, validate_governance_time_interval, validate_source_provenance,
};
pub const DEFAULT_NNS_GOVERNANCE_SOURCE_ENDPOINT: &str = "https://icp-api.io";
pub const MAX_NNS_GOVERNANCE_RESPONSE_BYTES: usize = 8 * 1024 * 1024;
const NNS_GOVERNANCE_REPORT_SCHEMA_VERSION: u32 = 1;
#[cfg(all(test, feature = "nns-host"))]
mod tests;
#[cfg(all(test, feature = "nns-host", not(target_arch = "wasm32")))]
mod testkit;