This commit is contained in:
Jaremy Creechley 2023-12-07 22:49:45 -07:00
parent 88b9bc270e
commit 50009d46d1
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300

View File

@ -244,20 +244,26 @@ mod tests {
let mut arg_chunks: Vec<Vec<U256>> = Vec::new(); let mut arg_chunks: Vec<Vec<U256>> = Vec::new();
// deserialize the data back into u256's // deserialize the data back into u256's
// instead of this, we'll want to use `builder.push_input`
args["chunks"] args["chunks"]
.as_array() .as_array()
.unwrap() .unwrap()
.iter() .iter()
.for_each(|c| { .for_each(|c| {
let x = c.as_array().unwrap(); if let Some(x) = c.as_array() {
let mut vals: Vec<U256> = Vec::new(); let mut vals: Vec<U256> = Vec::new();
x.iter().for_each(|n| { x.iter().for_each(|n| {
let b = n.as_ext().unwrap(); let b = n.as_ext().unwrap();
// ensure it's a LE uin256 which we've set as ext 50 // ensure it's a LE uin256 which we've set as ext 50
assert_eq!(b.0, 50); assert_eq!(b.0, 50);
vals.push(U256::try_from_le_slice(b.1).unwrap()); vals.push(U256::try_from_le_slice(b.1).unwrap());
}); // TODO: change to use
arg_chunks.push(vals); // builder.push_input("hashes", *c)
});
arg_chunks.push(vals);
} else {
panic!("unhandled type!");
}
}); });
assert_eq!(arg_chunks.len(), 4); assert_eq!(arg_chunks.len(), 4);