From 729957508d377a62aa84b90c1d1bf58e9a935c90 Mon Sep 17 00:00:00 2001 From: Dmitry Novikov Date: Fri, 12 Jan 2024 07:25:17 +0400 Subject: [PATCH] Fix expected string in test --- pallets/gear/src/tests.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pallets/gear/src/tests.rs b/pallets/gear/src/tests.rs index baebc898992..10304d457cb 100644 --- a/pallets/gear/src/tests.rs +++ b/pallets/gear/src/tests.rs @@ -8341,22 +8341,19 @@ fn call_forbidden_function() { run_to_block(2, None); - let res = Gear::calculate_gas_info( + let err = Gear::calculate_gas_info( USER_1.into_origin(), HandleKind::Handle(prog_id), EMPTY_PAYLOAD.to_vec(), 0, true, true, - ); + ) + .expect_err("Must return error"); - assert_eq!( - res, - Err(format!( - "Program terminated with a trap: {}", - TrapExplanation::ForbiddenFunction, - )) - ); + let trap = TrapExplanation::ForbiddenFunction; + + assert_eq!(err, format!("Program terminated with a trap: '{trap}'")); }); }