wip

refac common module

+30 -27
+4
Cargo.toml
··· 23 23 [dev-dependencies] 24 24 hex-literal = "0.4.1" 25 25 26 + [profile.release] 27 + opt-level = 3 28 + lto = true 29 + 26 30 [workspace] 27 31 resolver = "2" 28 32 members = [
+2 -2
common/Cargo.toml
··· 2 2 name = "vnd-atproto-common" 3 3 version = "0.0.1" 4 4 authors = ["Edouard Paris <m@edouard.paris>"] 5 - edition = "2018" 5 + edition = "2024" 6 6 description = "Vanadium app for atproto plc" 7 7 8 8 [dependencies] 9 - serde = { version = "1.0", default-features = false, features = ["alloc"] } 9 + serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
+1 -25
common/src/lib.rs
··· 2 2 3 3 extern crate alloc; 4 4 5 - pub mod message { 6 - use alloc::{string::String, vec::Vec}; 7 - use serde::{Deserialize, Serialize}; 8 - 9 - #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] 10 - pub enum Request { 11 - Exit, 12 - GetDidKey { index: u32, display: bool }, 13 - // SignPlcOperation { 14 - // key_index: u32, 15 - // previous: Option<PlcOperation>, 16 - // operation: PlcOperation, 17 - // }, 18 - } 19 - 20 - #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] 21 - pub enum PlcOperation {} 22 - 23 - #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] 24 - pub enum Response { 25 - DidKey(Vec<u8>), 26 - // Signature(Vec<u8>), 27 - Error(String), 28 - } 29 - } 5 + pub mod message;
+23
common/src/message.rs
··· 1 + use alloc::{string::String, vec::Vec}; 2 + use serde::{Deserialize, Serialize}; 3 + 4 + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] 5 + pub enum Request { 6 + Exit, 7 + GetDidKey { index: u32, display: bool }, 8 + // SignPlcOperation { 9 + // key_index: u32, 10 + // previous: Option<PlcOperation>, 11 + // operation: PlcOperation, 12 + // }, 13 + } 14 + 15 + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] 16 + pub enum PlcOperation {} 17 + 18 + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] 19 + pub enum Response { 20 + DidKey(Vec<u8>), 21 + // Signature(Vec<u8>), 22 + Error(String), 23 + }