Skip to content

Commit

Permalink
update rs lib
Browse files Browse the repository at this point in the history
  • Loading branch information
chcmedeiros committed Sep 20, 2024
1 parent 76b17c0 commit cbea9d2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,17 +625,20 @@ where

/// Clean buffers
pub async fn clean_randomness_buffers(&self) -> Result<(), NamError<E::Error>> {
let start_command = APDUCommand {
let arr: &[u8] = &[];
let command = APDUCommand {
cla: CLA,
ins: InstructionCode::CleanBuffers as _,
p1: ChunkPayloadType::Init as u8,
p2: 0x00,
data: &[], // Send empty data
data: arr, // Send empty data
};

let response =
<Self as AppExt<E>>::send_chunks(&self.apdu_transport, start_command, blob).await?;

self
.apdu_transport
.exchange(&command)
.await
.map_err(LedgerAppError::TransportError)?;
Ok(())
}
}

0 comments on commit cbea9d2

Please sign in to comment.