nym_performance_contract_common/
msg.rs1use crate::{EpochId, NodeId, NodePerformance};
5use cosmwasm_schema::cw_serde;
6
7#[cfg(feature = "schema")]
8use crate::types::{
9 EpochMeasurementsPagedResponse, EpochPerformancePagedResponse,
10 FullHistoricalPerformancePagedResponse, LastSubmission, NetworkMonitorResponse,
11 NetworkMonitorsPagedResponse, NodeMeasurementsResponse, NodePerformancePagedResponse,
12 NodePerformanceResponse, RetiredNetworkMonitorsPagedResponse,
13};
14
15#[cw_serde]
16pub struct InstantiateMsg {
17 pub mixnet_contract_address: String,
18 pub authorised_network_monitors: Vec<String>,
19}
20
21#[cw_serde]
22pub enum ExecuteMsg {
23 UpdateAdmin { admin: String },
25
26 Submit {
28 epoch: EpochId,
29 data: NodePerformance,
30 },
31
32 BatchSubmit {
34 epoch: EpochId,
35 data: Vec<NodePerformance>,
36 },
37
38 AuthoriseNetworkMonitor { address: String },
40
41 RetireNetworkMonitor { address: String },
43
44 RemoveNodeMeasurements { epoch_id: EpochId, node_id: NodeId },
47
48 RemoveEpochMeasurements { epoch_id: EpochId },
52}
53
54#[cw_serde]
55#[cfg_attr(feature = "schema", derive(cosmwasm_schema::QueryResponses))]
56pub enum QueryMsg {
57 #[cfg_attr(feature = "schema", returns(cw_controllers::AdminResponse))]
58 Admin {},
59
60 #[cfg_attr(feature = "schema", returns(NodePerformanceResponse))]
62 NodePerformance { epoch_id: EpochId, node_id: NodeId },
63
64 #[cfg_attr(feature = "schema", returns(NodePerformancePagedResponse))]
66 NodePerformancePaged {
67 node_id: NodeId,
68 start_after: Option<EpochId>,
69 limit: Option<u32>,
70 },
71
72 #[cfg_attr(feature = "schema", returns(NodeMeasurementsResponse))]
74 NodeMeasurements { epoch_id: EpochId, node_id: NodeId },
75
76 #[cfg_attr(feature = "schema", returns(EpochMeasurementsPagedResponse))]
78 EpochMeasurementsPaged {
79 epoch_id: EpochId,
80 start_after: Option<NodeId>,
81 limit: Option<u32>,
82 },
83
84 #[cfg_attr(feature = "schema", returns(EpochPerformancePagedResponse))]
86 EpochPerformancePaged {
87 epoch_id: EpochId,
88 start_after: Option<NodeId>,
89 limit: Option<u32>,
90 },
91
92 #[cfg_attr(feature = "schema", returns(FullHistoricalPerformancePagedResponse))]
94 FullHistoricalPerformancePaged {
95 start_after: Option<(EpochId, NodeId)>,
96 limit: Option<u32>,
97 },
98
99 #[cfg_attr(feature = "schema", returns(NetworkMonitorResponse))]
101 NetworkMonitor { address: String },
102
103 #[cfg_attr(feature = "schema", returns(NetworkMonitorsPagedResponse))]
105 NetworkMonitorsPaged {
106 start_after: Option<String>,
107 limit: Option<u32>,
108 },
109
110 #[cfg_attr(feature = "schema", returns(RetiredNetworkMonitorsPagedResponse))]
112 RetiredNetworkMonitorsPaged {
113 start_after: Option<String>,
114 limit: Option<u32>,
115 },
116
117 #[cfg_attr(feature = "schema", returns(LastSubmission))]
119 LastSubmittedMeasurement {},
120}
121
122#[cw_serde]
123pub struct MigrateMsg {
124 }