@@ -43,6 +43,18 @@ macro_rules! exit_ooe {
4343 } ;
4444}
4545
46+ impl InvocationData {
47+ /// An internal helper function to construct a [`DebugTraceElement`] from a
48+ /// set of debug events.
49+ pub ( crate ) fn debug_trace ( & self , debug_trace : DebugTracker ) -> DebugTraceElement {
50+ DebugTraceElement :: Debug {
51+ entrypoint : self . entrypoint . clone ( ) ,
52+ address : self . address ,
53+ debug_trace,
54+ }
55+ }
56+ }
57+
4658/// Ok response from the `invoke_entrypoint_initial` method. This is the
4759/// execution up to either success, failure, or the first interrupt.
4860///
@@ -722,13 +734,13 @@ impl<'a, 'b> EntrypointInvocationHandler<'a, 'b> {
722734 kind : v1:: InvokeFailure :: NonExistentAccount ,
723735 } ,
724736 } ;
725-
726737 exit_ooe ! (
727738 self . remaining_energy. tick_energy(
728739 constants:: CONTRACT_INSTANCE_QUERY_ACCOUNT_BALANCE_COST ,
729740 ) ,
730741 trace
731742 ) ;
743+ trace_elements. push ( invocation_data. debug_trace ( trace) ) ;
732744 stack. push ( Next :: Resume {
733745 data : invocation_data,
734746 config,
@@ -757,6 +769,7 @@ impl<'a, 'b> EntrypointInvocationHandler<'a, 'b> {
757769 ) ,
758770 trace
759771 ) ;
772+ trace_elements. push ( invocation_data. debug_trace ( trace) ) ;
760773 stack. push ( Next :: Resume {
761774 data : invocation_data,
762775 config,
@@ -782,6 +795,7 @@ impl<'a, 'b> EntrypointInvocationHandler<'a, 'b> {
782795 trace
783796 ) ;
784797
798+ trace_elements. push ( invocation_data. debug_trace ( trace) ) ;
785799 stack. push ( Next :: Resume {
786800 data : invocation_data,
787801 config,
@@ -853,6 +867,7 @@ impl<'a, 'b> EntrypointInvocationHandler<'a, 'b> {
853867 kind : v1:: InvokeFailure :: NonExistentAccount ,
854868 } ,
855869 } ;
870+ trace_elements. push ( invocation_data. debug_trace ( trace) ) ;
856871 stack. push ( Next :: Resume {
857872 data : invocation_data,
858873 config,
@@ -889,6 +904,7 @@ impl<'a, 'b> EntrypointInvocationHandler<'a, 'b> {
889904 kind : v1:: InvokeFailure :: NonExistentAccount ,
890905 } ,
891906 } ;
907+ trace_elements. push ( invocation_data. debug_trace ( trace) ) ;
892908 stack. push ( Next :: Resume {
893909 data : invocation_data,
894910 config,
0 commit comments