Skip to content

Commit

Permalink
use seed and chain length
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfirefist committed Apr 25, 2024
1 parent 7dc3aaa commit f598ab6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apps/fortuna/provider-config.sample.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
chains:
lightlink-pegasus:
commitments:
- metadata: db7dd9c5ea58d07815b5ac8fef6629e9a7d4ed6a25ffb8a5ee79e69b749ead301027000000000000
- seed: [219,125,217,197,234,88,208,120,21,181,172,143,239,102,41,233,167,212,237,106,37,255,184,165,238,121,230,155,116,158,173,48]
chain_length: 10000
original_commitment_sequence_number: 104
7 changes: 2 additions & 5 deletions apps/fortuna/src/command/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use {
Result,
},
axum::Router,
hex,
std::{
collections::HashMap,
net::SocketAddr,
Expand Down Expand Up @@ -153,15 +152,13 @@ pub async fn run(opts: &RunOptions) -> Result<()> {
let mut hash_chains = provider_commitments
.iter()
.map(|x| {
let metadata =
bincode::deserialize::<CommitmentMetadata>(hex::decode(&x.metadata)?.as_ref())?;
PebbleHashChain::from_config(
&secret,
&chain_id,
&opts.provider,
&chain_config.contract_addr,
&metadata.seed,
metadata.chain_length,
&x.seed,
x.chain_length,
)
})
.collect::<Result<Vec<PebbleHashChain>>>()?;
Expand Down
3 changes: 2 additions & 1 deletion apps/fortuna/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ impl ProviderChainConfig {

#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct Commitment {
pub metadata: String,
pub seed: [u8; 32],
pub chain_length: u64,
pub original_commitment_sequence_number: u64,
}

0 comments on commit f598ab6

Please sign in to comment.