From 4cbe1fcd37f3d6035890c548ec47bfb6f946dace Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 20 Jul 2022 13:08:27 -0300 Subject: [PATCH] move lazy static out of method --- zebra-chain/src/orchard/commitment.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zebra-chain/src/orchard/commitment.rs b/zebra-chain/src/orchard/commitment.rs index cc146ffbec6..b09721172e7 100644 --- a/zebra-chain/src/orchard/commitment.rs +++ b/zebra-chain/src/orchard/commitment.rs @@ -301,17 +301,16 @@ impl ValueCommitment { /// #[allow(non_snake_case)] pub fn new(rcv: pallas::Scalar, value: Amount) -> Self { - lazy_static! { - static ref V: pallas::Point = pallas_group_hash(b"z.cash:Orchard-cv", b"v"); - static ref R: pallas::Point = pallas_group_hash(b"z.cash:Orchard-cv", b"r"); - } - let v = pallas::Scalar::from(value); - Self::from(*V * v + *R * rcv) } } +lazy_static! { + static ref V: pallas::Point = pallas_group_hash(b"z.cash:Orchard-cv", b"v"); + static ref R: pallas::Point = pallas_group_hash(b"z.cash:Orchard-cv", b"r"); +} + #[cfg(test)] mod tests {