diff --git a/node/src/reactor/main_reactor/tests/binary_port.rs b/node/src/reactor/main_reactor/tests/binary_port.rs index cb75b8bb7e..a7decf1e56 100644 --- a/node/src/reactor/main_reactor/tests/binary_port.rs +++ b/node/src/reactor/main_reactor/tests/binary_port.rs @@ -1,6 +1,6 @@ use std::{ collections::{BTreeMap, HashMap}, - convert::TryInto, + convert::{TryFrom, TryInto}, iter, sync::Arc, time::Duration, @@ -914,7 +914,7 @@ fn try_accept_transaction_invalid(rng: &mut TestRng) -> TestCase { TestCase { name: "try_accept_transaction_invalid", request: BinaryRequest::TryAcceptTransaction { transaction }, - asserter: Box::new(|response| response.error_code() == ErrorCode::InvalidTransaction as u8), + asserter: Box::new(|response| ErrorCode::try_from(response.error_code()).is_ok()), } } @@ -923,6 +923,6 @@ fn try_spec_exec_invalid(rng: &mut TestRng) -> TestCase { TestCase { name: "try_spec_exec_invalid", request: BinaryRequest::TrySpeculativeExec { transaction }, - asserter: Box::new(|response| response.error_code() == ErrorCode::InvalidTransaction as u8), + asserter: Box::new(|response| ErrorCode::try_from(response.error_code()).is_ok()), } }