Compare changes

Choose any two refs to compare.

Changed files
+56 -26
cli
client
common
-19
cli/operation.json
···
-
{
-
"type": "plc_operation",
-
"services": {
-
"atproto_pds": {
-
"type": "AtprotoPersonalDataServer",
-
"endpoint": "https://bsky.social"
-
}
-
},
-
"alsoKnownAs": [
-
"at://atproto.com"
-
],
-
"rotationKeys": [
-
"did:key:zQ3shhCGUqDKjStzuDxPkTxN6ujddP4RkEKJJouJGRRkaLGbg",
-
"did:key:zQ3shpKnbdPx3g3CmPf5cRVTPe1HtSwVn5ish3wSnDPQCbLJK"
-
],
-
"verificationMethods": {
-
"atproto": "did:key:zQ3shXjHeiBuRCKmM36cuYnm7YEMzhGnCmCyW92sRJ9pribSF"
-
}
-
}
+4 -2
Cargo.lock
···
[[package]]
name = "cid"
version = "0.11.1"
-
source = "git+https://github.com/edouardparis/rust-cid?branch=fix-dep-serde_bytes-features#d8aeda78e2dd4784dbea3086a6ca85fa88782d2d"
+
source = "git+https://github.com/multiformats/rust-cid?branch=master#6a13cb931d3237e5e1f5635a943edfd166e2e78c"
dependencies = [
"core2",
"multibase",
···
[[package]]
name = "serde_ipld_dagcbor"
version = "0.6.3"
-
source = "git+http://github.com/edouardparis/serde_ipld_dagcbor?branch=scopeguard-no-default-features#82eca93ee126750ad80feedbfe9cee0bf162c587"
+
source = "git+http://github.com/ipld/serde_ipld_dagcbor?branch=master#d7f93d06ce6a19867abeea78d02d6ded6c476b81"
dependencies = [
"cbor4ii",
"ipld-core",
···
version = "0.0.1"
dependencies = [
"base58",
+
"cid",
"hex-literal",
"k256",
"postcard",
···
"base32",
"base58",
"base64",
+
"cid",
"clap",
"hidapi",
"ledger-transport-hid",
+20
cli/previous_operation.json
···
+
{
+
"alsoKnownAs": [
+
"at://test-vnd.edouard.paris"
+
],
+
"prev": null,
+
"rotationKeys": [
+
"did:key:zQ3shiNS7Bm7F3AH5NU4uimiSpZ8ryYj365Uq1N7KMsWUaXKp"
+
],
+
"services": {
+
"atproto_pds": {
+
"endpoint": "https://pds.edouard.paris",
+
"type": "AtprotoPersonalDataServer"
+
}
+
},
+
"sig": "kfShJ7A67jZAjZhydcnz3HRnrlE0NqocV2RmjRNlCB5hyj4Qiw51Kn_Bkqj704KYOTEiyhpiVajRc-qVc9ssWw",
+
"type": "plc_operation",
+
"verificationMethods": {
+
"atproto": "did:key:zQ3shiNS7Bm7F3AH5NU4uimiSpZ8ryYj365Uq1N7KMsWUaXKp"
+
}
+
}
+1 -1
client/Cargo.toml
···
postcard = { version = "1.1.1", features = ["alloc"] }
common = { package = "vnd-atproto-common", path = "../common"}
sdk = { package = "vanadium-client-sdk", git = "https://github.com/LedgerHQ/vanadium"}
-
serde_ipld_dagcbor = { git = "http://github.com/edouardparis/serde_ipld_dagcbor", branch = "scopeguard-no-default-features", default-features = false }
+
serde_ipld_dagcbor = { git = "http://github.com/ipld/serde_ipld_dagcbor", branch = "master", default-features = false }
+4 -3
client/src/lib.rs
···
-
pub use common::message::PlcOperation;
+
pub use common::message::{PlcOperation, SignedPlcOperation};
use common::message::{Request, Response};
use sdk::vanadium_client::{VAppClient, VAppExecutionError};
···
&mut self,
key_index: u32,
operation: PlcOperation,
-
previous: Option<PlcOperation>,
+
previous: Option<SignedPlcOperation>,
) -> Result<Vec<u8>, AtprotoAppClientError> {
let msg = postcard::to_allocvec(&Request::SignPlcOperation {
key_index,
previous,
operation,
})
-
.map_err(|_| {
+
.map_err(|e| {
+
eprintln!("{:?}", e);
AtprotoAppClientError::GenericError("Failed to serialize SignPlcOperation request")
})?;
+27 -1
common/src/message.rs
···
},
SignPlcOperation {
key_index: u32,
-
previous: Option<PlcOperation>,
operation: PlcOperation,
+
previous: Option<SignedPlcOperation>,
},
}
···
pub prev: Option<String>,
}
+
impl PlcOperation {
+
pub fn signed(self, sig: String) -> SignedPlcOperation {
+
SignedPlcOperation {
+
r#type: self.r#type,
+
rotation_keys: self.rotation_keys,
+
verification_methods: self.verification_methods,
+
also_known_as: self.also_known_as,
+
services: self.services,
+
prev: self.prev,
+
sig,
+
}
+
}
+
}
+
+
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
+
#[serde(rename_all = "camelCase")]
+
pub struct SignedPlcOperation {
+
pub r#type: String,
+
pub rotation_keys: Vec<String>,
+
pub verification_methods: VerificationMethods,
+
pub also_known_as: Vec<String>,
+
pub services: Services,
+
pub prev: Option<String>,
+
pub sig: String,
+
}
+
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct VerificationMethods {