Skip to content

Commit

Permalink
chore: replace blob_from_hex with bytes_from_hex
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed May 29, 2024
1 parent 7b7c634 commit 200f441
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions eip7594/tests/common.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use eip7594::Blob;
use eip7594::{Bytes48, Cell};

/// Data from the test input could also be malformed,
Expand Down Expand Up @@ -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<u8> {
let bytes = remove_hex_prefix(&bytes);
hex::decode(bytes).unwrap()
Expand Down
4 changes: 2 additions & 2 deletions eip7594/tests/compute_cells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions eip7594/tests/compute_cells_and_kzg_proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)) => {
Expand Down

0 comments on commit 200f441

Please sign in to comment.