mirror of
https://github.com/logos-storage/logos-storage-proofs.git
synced 2026-01-02 13:33:10 +00:00
chunks
This commit is contained in:
parent
88b9bc270e
commit
50009d46d1
24
src/ffi.rs
24
src/ffi.rs
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user