1use ethers::prelude::{Address, LocalWallet};
2use tokio::sync::{
3 mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
4 oneshot::Sender,
5};
6
7pub enum ServiceMessage {
8 CreateTask(u64, Address, Vec<u8>, Vec<u8>),
10 AcceptTask(u64, i64, bool),
12 ApproveProver(Address, u64, u64),
14 UploadProof(String, Vec<u8>),
16 ChangeController(LocalWallet, Vec<u8>),
18 PullProver(Address, String, String, u64),
20 RemoveProver(Address),
22 MinerTest(u64, Address, i64, Vec<u8>, Vec<u8>),
24 ApiTask(String, Option<Sender<Vec<u8>>>),
26 TaskHeartbeat,
28}
29
30pub fn new_service_channel() -> (
31 UnboundedSender<ServiceMessage>,
32 UnboundedReceiver<ServiceMessage>,
33) {
34 unbounded_channel()
35}