File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,6 @@ pub enum RuntimeErrorType {
101101 PoxAlreadyLocked ,
102102
103103 BlockTimeNotAvailable ,
104- Unreachable ,
105104}
106105
107106#[ derive( Debug , PartialEq ) ]
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use clarity::vm::contexts::GlobalContext;
1919use clarity:: vm:: costs:: cost_functions:: ClarityCostFunction ;
2020use clarity:: vm:: costs:: runtime_cost;
2121use clarity:: vm:: database:: { ClarityDatabase , STXBalance } ;
22- use clarity:: vm:: errors:: { Error as ClarityError , RuntimeErrorType } ;
22+ use clarity:: vm:: errors:: { Error as ClarityError , InterpreterError , RuntimeErrorType } ;
2323use clarity:: vm:: events:: { STXEventType , STXLockEventData , StacksTransactionEvent } ;
2424use clarity:: vm:: types:: { PrincipalData , QualifiedContractIdentifier } ;
2525use clarity:: vm:: { Environment , Value } ;
@@ -401,13 +401,16 @@ pub fn handle_contract_call(
401401 global_context. log_stacking ( sender, * amount) ?;
402402 }
403403 _ => {
404+ let msg = "Unreachable: failed to log STX delegation in PoX-4 delegate-stx call" ;
404405 // This should be unreachable!
405406 error ! (
406- "Unreachable: failed to log STX delegation in PoX-4 delegate-stx call " ;
407+ "{msg} " ;
407408 "sender" => ?sender_opt,
408409 "arg0" => ?args. first( ) ,
409410 ) ;
410- return Err ( ClarityError :: Runtime ( RuntimeErrorType :: Unreachable , None ) ) ;
411+ return Err ( ClarityError :: Interpreter ( InterpreterError :: Expect (
412+ msg. into ( ) ,
413+ ) ) ) ;
411414 }
412415 }
413416 }
You can’t perform that action at this time.
0 commit comments