Skip to content

Conversation

@blurpesec
Copy link
Contributor

This pull request introduces a significant refactor and enhancement of the storage system's withdrawal logic, primarily by splitting the previous withdraw function into two distinct operations: withdraw (now simplified) and a new transferToPlayer function. The changes clarify the semantics of withdrawing items from storage buckets, improve authorization checks, and add more granular control over item transfers. Test coverage is updated and expanded to reflect and verify the new logic.

Core Storage Logic Refactor:

  • Introduced a new transferToPlayer function in StorageSystem, enabling direct transfers from a bucket to a specified player’s ephemeral inventory, with improved authorization and clearer separation of responsibilities. The original withdraw function is now a wrapper that calls transferToPlayer for the message initiator. [1] [2]
  • Updated StorageSystemLib to include new internal and root call wrappers for transferToPlayer, and refactored the withdraw wrappers to remove the useOwnerInventory parameter, aligning with the new function signatures. [1] [2] [3]
  • Added and updated corresponding interfaces for the new and modified functions in the codegen and world interface files. [1] [2]

Test Suite Updates and Additions:

  • Refactored all usages of the old withdraw function in tests to use either the new withdraw or transferToPlayer as appropriate, including updating parameters and expected behaviors. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Added a comprehensive new test testWithdrawFullFromBucketToPlayer to verify the full withdrawal and transfer process, including authorization checks, balance updates, and cleanup of inventory records.

Other Changes:

  • Bumped the package version from 0.2.3 to 0.2.4 to reflect the breaking and additive changes.
  • Renamed and stubbed out a test function in StoreAuthDelegatedAccessTest for future proxy transfer system tests.

@blurpesec blurpesec changed the title feat: allow for withdraw to a different players inventory feat: allow for withdraw to a different player's inventory Aug 30, 2025
@blurpesec blurpesec merged commit ea82f29 into main Aug 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants