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.
This commit is contained in:
Janito Vaqueiro Ferreira Filho 2021-07-08 22:49:55 -03:00 committed by GitHub
parent 40e350c342
commit 23fe2c2e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View File

@ -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_.

View File

@ -43,9 +43,6 @@ mod tests;
pub struct Verifier<ZS> {
network: Network,
script_verifier: script::Verifier<ZS>,
// spend_verifier: groth16::Verifier,
// output_verifier: groth16::Verifier,
// joinsplit_verifier: groth16::Verifier,
}
impl<ZS> Verifier<ZS>
@ -53,16 +50,10 @@ where
ZS: Service<zs::Request, Response = zs::Response, Error = BoxError> + Send + Clone + 'static,
ZS::Future: Send + 'static,
{
// XXX: how should this struct be constructed?
pub fn new(network: Network, script_verifier: script::Verifier<ZS>) -> 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();