terra-money / warp-contracts

Other
15 stars 14 forks source link

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

Closed dev8723 closed 1 year ago

dev8723 commented 1 year ago

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 #51 and #57 , withdraw will be triggered when job is deleted, evicted and executed (if no recurring job created).
  8. covers #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

Migration required

dev8723 commented 1 year ago

WARP 2.0 is coming 🚀🚀🚀