aleph-im / aleph-vm

Aleph.im VM execution engine
MIT License
43 stars 18 forks source link

Fix is_confidential property #674

Closed olethanh closed 1 month ago

olethanh commented 1 month ago

This was causing an error in the monitor payment task

AttributeError: 'FunctionEnvironment' object has no attribute 'trusted_execution'
  File "aleph/vm/utils/__init__.py", line 90, in run_and_log_exception
    return await coro
  File "aleph/vm/orchestrator/tasks.py", line 154, in monitor_payments
    executions = [execution for execution in executions if execution.is_confidential]
  File "aleph/vm/orchestrator/tasks.py", line 154, in <listcomp>
    executions = [execution for execution in executions if execution.is_confidential]
  File "aleph/vm/models.py", line 113, in is_confidential
    return True if self.message.environment.trusted_execution else False

To reproduce

Run a program so it's in the execution lists for example a permanent one, Then wait for the monitory_payments task to run

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.53%. Comparing base (ff6c119) to head (c3e065d). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #674 +/- ## ========================================== + Coverage 61.43% 61.53% +0.10% ========================================== Files 68 68 Lines 5997 5997 Branches 635 635 ========================================== + Hits 3684 3690 +6 + Misses 2158 2153 -5 + Partials 155 154 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.