refactor: remove unneded functions
This commit is contained in:
parent
24611a2357
commit
c416547067
3 changed files with 3 additions and 21 deletions
|
|
@ -8,7 +8,6 @@ use serde_json::Value;
|
||||||
pub fn block2poly(val: &Value) -> Result<Vec<u8>> {
|
pub fn block2poly(val: &Value) -> Result<Vec<u8>> {
|
||||||
// Convert JSON data in to a u128
|
// Convert JSON data in to a u128
|
||||||
// TODO: Transfer decoding into own function?
|
// TODO: Transfer decoding into own function?
|
||||||
eprintln!("Decoded is: {:?}", val["block"]);
|
|
||||||
let string: String = serde_json::from_value(val["block"].clone())?;
|
let string: String = serde_json::from_value(val["block"].clone())?;
|
||||||
let decoded: Vec<u8> = BASE64_STANDARD.decode(string)?;
|
let decoded: Vec<u8> = BASE64_STANDARD.decode(string)?;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,25 +24,6 @@ pub fn parse_json(json: String) -> Result<Testcases> {
|
||||||
Ok(deserialised)
|
Ok(deserialised)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
pub fn generate_response_payload(
|
|
||||||
testcase_id: String,
|
|
||||||
payload: Value,
|
|
||||||
) -> Result<HashMap<String, Value>> {
|
|
||||||
let mut hashmap = HashMap::new();
|
|
||||||
hashmap.insert(testcase_id, payload);
|
|
||||||
Ok(hashmap)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn generate_response(payloads: HashMap<String, Value>) -> Result<Value> {
|
|
||||||
let response: Responses = Responses {
|
|
||||||
responses: payloads,
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(serde_json::to_value(response).unwrap())
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
@ -104,6 +85,8 @@ mod tests {
|
||||||
testcase_1.action
|
testcase_1.action
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Reactivate tests
|
||||||
/*
|
/*
|
||||||
#[test]
|
#[test]
|
||||||
fn test_response_payload_generation() {
|
fn test_response_payload_generation() {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ pub fn get_coefficients(num: u128) -> Vec<u8> {
|
||||||
for shift in 0..128 {
|
for shift in 0..128 {
|
||||||
//println!("{:?}", ((num >> shift) & 1));
|
//println!("{:?}", ((num >> shift) & 1));
|
||||||
if ((num >> shift) & 1) == 1 {
|
if ((num >> shift) & 1) == 1 {
|
||||||
println!("Shift success");
|
dbg!("Shift success");
|
||||||
powers.push(shift);
|
powers.push(shift);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue