Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/api/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct BackupChunk {
pub chunk_index: u32,
#[n(1)]
pub total_chunks: u32,
#[n(2)]
#[cbor(n(2), with = "minicbor::bytes")]
pub data: Vec<u8>,
}

Expand Down
4 changes: 2 additions & 2 deletions api/src/api/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ pub struct SignPsbt {
pub struct AccountUpdate {
#[n(0)]
pub account_id: String,
#[n(1)]
#[cbor(n(1), with = "minicbor::bytes")]
pub update: Vec<u8>,
}

#[quantum_link]
pub struct BroadcastTransaction {
#[n(0)]
pub account_id: String,
#[n(1)]
#[cbor(n(1), with = "minicbor::bytes")]
pub psbt: Vec<u8>,
}

Expand Down
11 changes: 7 additions & 4 deletions api/src/api/firmware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ pub enum FirmwareFetchEvent {
// envoy is sending a chunk for an update patch
#[n(3)]
Chunk(#[n(0)] FirmwareChunk),
// envoy has sent all the update patches
#[n(4)]
Complete,
// envoy failed
#[n(5)]
Error(#[n(0)] String),
Expand All @@ -71,10 +68,16 @@ pub struct FirmwareChunk {
pub chunk_index: u16,
#[n(3)]
pub total_chunks: u16,
#[n(4)]
#[cbor(n(4), with = "minicbor::bytes")]
pub data: Vec<u8>,
}

impl FirmwareChunk {
pub fn is_last(&self) -> bool {
self.patch_index == self.total_patches - 1 && self.chunk_index == self.total_chunks - 1
}
}

#[quantum_link]
pub enum FirmwareUpdateResult {
#[n(0)]
Expand Down
2 changes: 1 addition & 1 deletion api/src/api/pairing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct PairingResponse {

#[quantum_link]
pub struct PairingRequest {
#[n(0)]
#[cbor(n(0), with = "minicbor::bytes")]
pub xid_document: Vec<u8>,
#[n(1)]
pub device_name: String,
Expand Down
4 changes: 2 additions & 2 deletions api/src/api/scv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ pub enum SecurityCheck {

#[quantum_link]
pub struct ChallengeRequest {
#[n(0)]
#[cbor(n(0), with = "minicbor::bytes")]
pub data: Vec<u8>,
}

#[quantum_link]
pub enum ChallengeResponseResult {
#[n(0)]
Success {
#[n(0)]
#[cbor(n(0), with = "minicbor::bytes")]
data: Vec<u8>,
},
#[n(1)]
Expand Down