Expected value in hex instead of base64
This commit is contained in:
parent
f4a3f38096
commit
f010b95948
@ -1,4 +1,5 @@
|
|||||||
use async_std::fs::{create_dir_all, read_dir, read_to_string, remove_file, File};
|
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 serde::{Deserialize, Serialize};
|
||||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
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"))?;
|
.ok_or(tide::Error::from_str(StatusCode::BadRequest, "Invalid ttl"))?;
|
||||||
|
|
||||||
// Decode the value from Base64
|
// 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,
|
Ok(value) => value,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return Ok(Response::builder(StatusCode::BadRequest)
|
return Ok(Response::builder(StatusCode::BadRequest)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user