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

[Feature] Switch to job account for new jobs going forward #74

Conversation

dev8723
Copy link
Contributor

@dev8723 dev8723 commented Oct 23, 2023

Last part of #63

Changes included

  1. delete controller's create_account endpoint, merge it to controller's create_job.
  2. update controller's create_job, it will always try to create job using a job account, if user doesn't have a job account tracker, create it then create account then create job (2 reply), if user has a job account tracker but no free job account, then create job account then create job (1 reply), if user has both job account tracker and a free job account, create job right in create_job.
  3. update some params and data structure of account contract.
  4. introduce job-account-tracker contract, it's like putting the old ACCOUNTS from controller to this contract, it tracks job account availability for all users.
  5. restore account to master branch version since it's deprecated, rename account to legacy-account.
  6. rename previously modified account to job-account.
  7. covers assets_to_withdraw should be triggered in delete job, evict job as well #51 and How should job's assets_to_withdraw apply to recurring job? #57 , withdraw will be triggered when job is deleted, evicted and executed (if no recurring job created).
  8. covers [low priority] Mark non payable endpoints as non payable #61 , also user must pay fee in all create_job, update_job and delete_job, we used to deduct fee from user's main warp account in update_job and delete_job, i think it's cleaner to make user pay when they call the function, consider user already created jobs, it's common that user has warp fee denom in their wallet.

Test

  • pending integration test via cw-multi-test.

Migration required

  • upload code of new job-account-tracker contract
  • instantiate new job-account-tracker contract
  • upload code of new job-account contract
  • migrate controller to add code ID of job-account contract and address of job-account-tracker contract to controller config, this will stop creating legacy-account and only create job account going forward

@dev8723 dev8723 changed the base branch from master to feature/latest_updates October 23, 2023 07:13
@dev8723 dev8723 changed the title [Feature] All new jobs will be using sub account going forward [Feature] Switch to sub account for new jobs going forward Oct 23, 2023
@dev8723 dev8723 changed the title [Feature] Switch to sub account for new jobs going forward [Feature] Switch to job account for new jobs going forward Oct 23, 2023
@dev8723
Copy link
Contributor Author

dev8723 commented Oct 24, 2023

WARP 2.0 is coming 🚀🚀🚀

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