From f010b959480dfb820474d23667258ba030040fb9 Mon Sep 17 00:00:00 2001 From: Sosthene Date: Tue, 17 Dec 2024 15:23:54 +0100 Subject: [PATCH] Expected value in hex instead of base64 --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a748ea3..ac8f44d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use async_std::fs::{create_dir_all, read_dir, read_to_string, remove_file, File}; +use sdk_common::sp_client::bitcoin::hex::FromHex; use serde::{Deserialize, Serialize}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; @@ -207,7 +208,7 @@ async fn handle_store(mut req: Request<()>) -> tide::Result { .ok_or(tide::Error::from_str(StatusCode::BadRequest, "Invalid ttl"))?; // Decode the value from Base64 - let value_bytes = match base64::decode(&data.value) { + let value_bytes = match Vec::from_hex(&data.value) { Ok(value) => value, Err(e) => { return Ok(Response::builder(StatusCode::BadRequest)