From bc49592e5fc8cb42acb111a601cd99cf50cd2a7c Mon Sep 17 00:00:00 2001 From: exfinen <47593166+exfinen@users.noreply.github.com> Date: Sun, 8 Dec 2024 11:15:05 +0900 Subject: [PATCH] quit with error if no eth balance is found --- tlsn/examples/binance/binance_prover.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tlsn/examples/binance/binance_prover.rs b/tlsn/examples/binance/binance_prover.rs index bff8035a6..f34d5344f 100644 --- a/tlsn/examples/binance/binance_prover.rs +++ b/tlsn/examples/binance/binance_prover.rs @@ -478,8 +478,10 @@ async fn build_proof_with_redactions(mut prover: Prover, api_key: &str let (_, recv_private_ranges) = find_ranges_regex( prover.recv_transcript().data(), &[r#""ETH","free":"(\d+\.\d\d)"#] - ); + if recv_private_ranges.len() == 0 { + panic!("No ETH balance found"); + } println!("Received private ranges: {:?}", recv_private_ranges); let builder = prover.commitment_builder();