From 6ffa9e3d6d5fe110e0ac8bb20998d2a33e56ef81 Mon Sep 17 00:00:00 2001 From: Jan Ferdinand Sauer Date: Sun, 6 Aug 2023 16:50:22 +0200 Subject: [PATCH] derive trait `GetSize` for `Proof` instead of implementing it manually --- triton-vm/src/proof.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/triton-vm/src/proof.rs b/triton-vm/src/proof.rs index 33331d6e..ec70418f 100644 --- a/triton-vm/src/proof.rs +++ b/triton-vm/src/proof.rs @@ -13,19 +13,9 @@ use crate::stark; /// Contains the necessary cryptographic information to verify a computation. /// Should be used together with a [`Claim`]. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, BFieldCodec)] +#[derive(Debug, Clone, GetSize, Serialize, Deserialize, PartialEq, Eq, BFieldCodec)] pub struct Proof(pub Vec); -impl GetSize for Proof { - fn get_stack_size() -> usize { - std::mem::size_of::() - } - - fn get_heap_size(&self) -> usize { - self.0.len() * std::mem::size_of::() - } -} - impl Proof { /// Get the height of the trace used during proof generation. /// This is an upper bound on the length of the computation this proof is for.