Skip to content

Commit 2f17f70

Browse files
author
Clément Turmel
committed
refactor(client-lib): ajust cardano database v2 example with new api
1 parent b7c238d commit 2f17f70

File tree

1 file changed

+14
-8
lines changed
  • examples/client-cardano-database-v2/src

1 file changed

+14
-8
lines changed

examples/client-cardano-database-v2/src/main.rs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,27 @@ async fn main() -> MithrilResult<()> {
121121
println!("Could not send usage statistics to the aggregator: {e:?}");
122122
}
123123

124-
println!(
125-
"Computing Cardano database snapshot '{}' message...",
126-
cardano_database_snapshot.hash
127-
);
124+
println!("Verifying Cardano database...",);
128125
let allow_missing_immutables_files = false;
129-
let message = wait_spinner(
130-
&progress_bar,
131-
MessageBuilder::new().compute_cardano_database_message(
126+
let merkle_proof = client
127+
.cardano_database_v2()
128+
.verify_cardano_database(
132129
&certificate,
133130
&cardano_database_snapshot,
134131
&immutable_file_range,
135132
allow_missing_immutables_files,
136133
&unpacked_dir,
137134
&verified_digests,
138-
),
135+
)
136+
.await?;
137+
138+
println!(
139+
"Computing Cardano database snapshot '{}' message...",
140+
cardano_database_snapshot.hash
141+
);
142+
let message = wait_spinner(
143+
&progress_bar,
144+
MessageBuilder::new().compute_cardano_database_message(&certificate, &merkle_proof),
139145
)
140146
.await?;
141147

0 commit comments

Comments
 (0)