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
#![feature(min_specialization)]

use serde::{Deserialize, Serialize};
use tea_actorx_core::ActorId;
use tea_codec::serde::TypeId;
use tea_tapp_common::TimestampShort;

pub mod error;

extern crate tea_codec as tea_sdk;

pub const NAME: &[u8] = b"com.tea.tokenstate-service-actor";

#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
#[response(())]
pub struct IsOutdatedRequest(pub ActorId);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
#[response(())]
pub struct IsOutdatedReply(pub bool);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
#[response(Vec<u8>)]
pub struct SaveToBufferRequest;

#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
#[response(())]
pub struct RestoreFromBuffer(pub Vec<u8>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
#[response(())]
pub struct RestoreFromLocal;

#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
#[response(())]
pub struct SavePersist;

#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
#[response(())]
pub struct UpgradeVersion {
	pub data: Vec<u8>,
	pub persist_only: bool,
	pub at_time: TimestampShort,
}