Skip to content

Commit

Permalink
Handler for get_master_fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
bigspider committed Jan 8, 2025
1 parent c98aaa9 commit cde5317
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/bitcoin/app/src/handlers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
use common::message::ResponseGetMasterFingerprint;
use sdk::curve::Curve;

pub fn handle_get_master_fingerprint() -> Result<ResponseGetMasterFingerprint, &'static str> {
// TODO: replace with proper sdk call
Ok(ResponseGetMasterFingerprint {
fingerprint: 0xf5acc2fd,
fingerprint: sdk::curve::Secp256k1::get_master_fingerprint(),
})
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_handle_get_master_fingerprint() {
let response = handle_get_master_fingerprint().unwrap();
assert_eq!(response.fingerprint, 0xf5acc2fdu32);
}
}

0 comments on commit cde5317

Please sign in to comment.