From 2e6d32400832addf7891f2587fadcdbcfd4a66ec Mon Sep 17 00:00:00 2001 From: winderica Date: Thu, 25 Jun 2026 00:40:30 +0800 Subject: [PATCH] Ensure challenges order consistency when creating replay transcript via `from` and `new` --- crates/primitives/src/transcripts/replay/mod.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/crates/primitives/src/transcripts/replay/mod.rs b/crates/primitives/src/transcripts/replay/mod.rs index 9c4e8197..5ba17791 100644 --- a/crates/primitives/src/transcripts/replay/mod.rs +++ b/crates/primitives/src/transcripts/replay/mod.rs @@ -20,9 +20,7 @@ pub struct ReplayTranscript { impl> From> for ReplayTranscript { fn from(value: RecordingTranscript) -> Self { - Self { - cached_challenges: value.cached_challenges, - } + Self::new(value.cached_challenges) } } @@ -58,9 +56,7 @@ impl> From> for ReplayTranscriptVar { fn from(value: RecordingTranscriptVar) -> Self { - Self { - cached_challenges: value.cached_challenges, - } + Self::new(value.cached_challenges) } } @@ -68,10 +64,7 @@ impl TranscriptGadget for ReplayTranscriptVar { type Config = Vec>; type Widget = ReplayTranscript; - fn new(mut cached_challenges: Vec>) -> Self - where - Self: Sized, - { + fn new(mut cached_challenges: Vec>) -> Self { cached_challenges.reverse(); Self { cached_challenges } }