-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadmin_state.rs
More file actions
46 lines (44 loc) · 1.67 KB
/
Copy pathadmin_state.rs
File metadata and controls
46 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::shared::permissions::SolverPermission;
use crate::ui::KeyInputState;
use crate::util::order_utils::BondSlashChoice;
#[derive(Clone, Debug)]
pub struct AddSolverState {
pub key_input: KeyInputState,
pub permission: SolverPermission,
}
#[derive(Clone, Debug)]
pub enum AdminMode {
Normal,
AddSolver(AddSolverState),
ConfirmAddSolver {
solver_pubkey: String,
permission: SolverPermission,
selected_button: bool, // true=Yes, false=No
},
WaitingAddSolver, // Waiting for Mostro response after admin-add-solver
SetupAdminKey(KeyInputState),
ConfirmAdminKey(String, bool), // (key_string, selected_button: true=Yes, false=No)
ConfirmTakeDispute(uuid::Uuid, bool), // (dispute_id, selected_button: true=Yes, false=No)
WaitingTakeDispute(uuid::Uuid), // (dispute_id)
ManagingDispute, // Mode for "Disputes in Progress" tab
ReviewingDisputeForFinalization {
dispute_id: uuid::Uuid,
/// Index of the selected button: 0=Pay Buyer, 1=Refund Seller, 2=Bond slash
selected_button_index: usize,
/// Anti-abuse bond slash choice (default: no slash).
bond: BondSlashChoice,
/// When true, show the bond slash overlay submenu.
slash_submenu_open: bool,
/// Highlighted index in [`BondSlashChoice::ALL`] while submenu is open.
slash_submenu_index: usize,
},
ConfirmFinalizeDispute {
dispute_id: uuid::Uuid,
/// true=Pay Buyer, false=Refund Seller
is_settle: bool,
bond: BondSlashChoice,
/// true=Yes, false=No
selected_button: bool,
},
WaitingDisputeFinalization(uuid::Uuid), // (dispute_id)
}