btc-vision / btc-runtime

Assemblyscript btc runtime
MIT License
4 stars 2 forks source link

Fix misnamed sender() and origin() methods, apply Prettier formatting, and update README #34

Closed impredmet closed 1 week ago

impredmet commented 1 week ago

Description:

This pull request includes several updates and improvements to the @btc-vision/btc-runtime package:

  1. Fix for sender() and origin() inversion:

    • Corrected a major issue where origin() was mistakenly representing the callee instead of the caller, and sender() was improperly set to return the callee. The functions were inverted, leading to misinterpretation in transaction flows.
    • Now, sender() correctly represents the direct caller (as it should), and origin() accurately reflects the original transaction initiator.
  2. Code Cleanup with Prettier:

    • Applied Prettier to the entire codebase to remove unused imports, maintain consistent code formatting, and improve overall readability.
  3. README Update:

    • Updated the README.md to fix the explanations for sender() and origin(), ensuring the documentation is in line with the corrected functionality.

This PR resolves key functional issues with transaction flow representation, cleans up the codebase, and updates the documentation for clarity.