Skip to content

Commit

Permalink
Update to Lighthouse Types (#5)
Browse files Browse the repository at this point in the history
Update to lighthouse
  • Loading branch information
ec2 authored Apr 4, 2024
1 parent bd7ceaf commit a5d8d27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ path = "rust-abi/lib.rs"
ethers = "2.0.10"
lightclient-circuits.workspace = true
eth-types.workspace = true
ssz_rs.workspace = true
halo2curves = { workspace = true }
itertools = { workspace = true }
halo2-base = { workspace = true }
halo2-base = { workspace = true }
tree_hash.workspace = true
17 changes: 5 additions & 12 deletions rust-abi/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#![feature(generic_const_exprs)]
use ethers::contract::abigen;
use lightclient_circuits::witness::SyncStepArgs;
use ssz_rs::Merkleized;
use std::ops::Deref;
use tree_hash::TreeHash;

abigen!(
Spectre,
"./out/Spectre.sol/Spectre.json";
Expand All @@ -28,20 +28,13 @@ impl<Spec: eth_types::Spec> From<SyncStepArgs<Spec>> for StepInput {
.map(|v| *v as u64)
.sum::<u64>();

let finalized_header_root: [u8; 32] = args
.finalized_header
.clone()
.hash_tree_root()
.unwrap()
.deref()
.try_into()
.unwrap();
let finalized_header_root: [u8; 32] = args.finalized_header.tree_hash_root().0;

let execution_payload_root: [u8; 32] = args.execution_payload_root.try_into().unwrap();

StepInput {
attested_slot: args.attested_header.slot,
finalized_slot: args.finalized_header.slot,
attested_slot: args.attested_header.slot.into(),
finalized_slot: args.finalized_header.slot.into(),
participation,
finalized_header_root,
execution_payload_root,
Expand Down

0 comments on commit a5d8d27

Please sign in to comment.