From 200f4415640e03090b998db6b000f7907db0c1e1 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Wed, 29 May 2024 15:49:58 +0100 Subject: [PATCH] chore: replace blob_from_hex with bytes_from_hex --- eip7594/tests/common.rs | 6 ------ eip7594/tests/compute_cells.rs | 4 ++-- eip7594/tests/compute_cells_and_kzg_proofs.rs | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/eip7594/tests/common.rs b/eip7594/tests/common.rs index e2922122..452d5587 100644 --- a/eip7594/tests/common.rs +++ b/eip7594/tests/common.rs @@ -1,4 +1,3 @@ -use eip7594::Blob; use eip7594::{Bytes48, Cell}; /// Data from the test input could also be malformed, @@ -45,11 +44,6 @@ fn remove_hex_prefix(s: &str) -> &str { } } -pub fn blob_from_hex(blob: &str) -> Blob { - let blob = remove_hex_prefix(&blob); - hex::decode(blob).unwrap() -} - pub fn bytes_from_hex(bytes: &str) -> Vec { let bytes = remove_hex_prefix(&bytes); hex::decode(bytes).unwrap() diff --git a/eip7594/tests/compute_cells.rs b/eip7594/tests/compute_cells.rs index ec3e2113..c2078a65 100644 --- a/eip7594/tests/compute_cells.rs +++ b/eip7594/tests/compute_cells.rs @@ -5,7 +5,7 @@ use std::fs; mod common; mod serde_ { - use super::common::{blob_from_hex, cell_from_hex}; + use super::common::{bytes_from_hex, cell_from_hex}; use eip7594::{Blob, Cell}; use serde::Deserialize; @@ -39,7 +39,7 @@ mod serde_ { let input = yaml_test_vector.input.blob; let output = yaml_test_vector.output; - let input = blob_from_hex(&input); + let input = bytes_from_hex(&input); let output = match output { Some(cells) => { diff --git a/eip7594/tests/compute_cells_and_kzg_proofs.rs b/eip7594/tests/compute_cells_and_kzg_proofs.rs index 6371fe04..6c5d996c 100644 --- a/eip7594/tests/compute_cells_and_kzg_proofs.rs +++ b/eip7594/tests/compute_cells_and_kzg_proofs.rs @@ -5,7 +5,7 @@ use std::fs; mod common; mod serde_ { - use super::common::{blob_from_hex, bytes48_from_hex, cell_from_hex}; + use super::common::{bytes48_from_hex, bytes_from_hex, cell_from_hex}; use eip7594::{Blob, Bytes48, Cell}; use serde::Deserialize; @@ -45,7 +45,7 @@ mod serde_ { let input = yaml_test_vector.input.blob; let output = yaml_test_vector.output; - let input = blob_from_hex(&input); + let input = bytes_from_hex(&input); let output = match output { Some((cells, kzg_proofs)) => {