Expected value in hex instead of base64

This commit is contained in:
Sosthene 2024-12-17 15:23:54 +01:00
parent f4a3f38096
commit f010b95948

View File

@ -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<Response> {
.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)