From 23fe2c2e94241769d04332e9d77d623924f41308 Mon Sep 17 00:00:00 2001 From: Janito Vaqueiro Ferreira Filho Date: Thu, 8 Jul 2021 22:49:55 -0300 Subject: [PATCH] Update panics by `todo!` and `unimplemented!` macros (#2471) * Add panic message to `unimplemented!` So that it is clear why the panic happened upon initial inspection. Also include a reference to the mempool epic, so that it's easier to find the issue that tracks the implementation of the missing code. * Add panic message that references a tracking issue Make it easy to find the relevant issue if the panic occurs. * Remove incomplete and currently unnecessary code The current implementation works, the commented out code was just a previous improvement idea, which is now tracked by issue #2473. --- zebra-chain/src/orchard/note/nullifiers.rs | 2 +- zebra-consensus/src/transaction.rs | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/zebra-chain/src/orchard/note/nullifiers.rs b/zebra-chain/src/orchard/note/nullifiers.rs index 16b9b908..6ccac05a 100644 --- a/zebra-chain/src/orchard/note/nullifiers.rs +++ b/zebra-chain/src/orchard/note/nullifiers.rs @@ -21,7 +21,7 @@ use super::super::{ /// [poseidonhash]: https://zips.z.cash/protocol/nu5.pdf#poseidonhash fn poseidon_hash(_x: pallas::Base, _y: pallas::Base) -> pallas::Base { // TODO: implement: #2064 - unimplemented!() + unimplemented!("PoseidonHash is not yet implemented (#2064)") } /// Used as part of deriving the _nullifier_ for a Orchard _note_. diff --git a/zebra-consensus/src/transaction.rs b/zebra-consensus/src/transaction.rs index a0824c92..d7b164e0 100644 --- a/zebra-consensus/src/transaction.rs +++ b/zebra-consensus/src/transaction.rs @@ -43,9 +43,6 @@ mod tests; pub struct Verifier { network: Network, script_verifier: script::Verifier, - // spend_verifier: groth16::Verifier, - // output_verifier: groth16::Verifier, - // joinsplit_verifier: groth16::Verifier, } impl Verifier @@ -53,16 +50,10 @@ where ZS: Service + Send + Clone + 'static, ZS::Future: Send + 'static, { - // XXX: how should this struct be constructed? pub fn new(network: Network, script_verifier: script::Verifier) -> Self { - // let (spend_verifier, output_verifier, joinsplit_verifier) = todo!(); - Self { network, script_verifier, - // spend_verifier, - // output_verifier, - // joinsplit_verifier, } } } @@ -153,7 +144,7 @@ where }; if is_mempool { // XXX determine exactly which rules apply to mempool transactions - unimplemented!(); + unimplemented!("Zebra does not yet have a mempool (#2309)"); } let script_verifier = self.script_verifier.clone();