delete controller's create_account endpoint, merge it to controller's create_job.
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.
update some params and data structure of account contract.
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.
restore account to master branch version since it's deprecated, rename account to legacy-account.
rename previously modified account to job-account.
covers #51 and #57 , withdraw will be triggered when job is deleted, evicted and executed (if no recurring job created).
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
[ ] 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
Last part of #63
Changes included
create_account
endpoint, merge it to controller'screate_job
.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 increate_job
.job-account-tracker
contract, it's like putting the oldACCOUNTS
from controller to this contract, it tracks job account availability for all users.account
tolegacy-account
.account
tojob-account
.create_job
,update_job
anddelete_job
, we used to deduct fee from user's main warp account inupdate_job
anddelete_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