Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: allow withdraw by users directly #25

Merged
merged 3 commits into from
Apr 5, 2023
Merged

Conversation

birchmd
Copy link
Contributor

@birchmd birchmd commented Mar 29, 2023

Description

In the spirit of being able to eventually remove all connector functionality from the Engine contract, we need a method to be able to Withdraw tokens that can be called by users directly. This PR renames the withdraw function to engine_withdraw as it can only be called by Engine instances, and adds a new withdraw function where the sender is not passed as an argument, but instead is determined from the predecessor_account_id. Since the sender is no longer specified by the user the withdraw function no longer needs to be protected; it can be called by any user.

Note aurora-is-near/aurora-engine#607 will need to be updated to call engine_withdraw instead of just withdraw.

Testing

New test for the engine_withdraw function. Existing tests for the permissionless withdraw function.

@birchmd birchmd added the enhancement New feature or request label Mar 29, 2023
@birchmd birchmd requested a review from mrLSD as a code owner March 29, 2023 18:34
Copy link
Collaborator

@mrLSD mrLSD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mrLSD mrLSD added this to the v0.4.2 milestone Mar 31, 2023
@birchmd birchmd merged commit 23ca014 into master Apr 5, 2023
@birchmd birchmd deleted the unrestricted-withdraw branch April 5, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants