Closed ChaoticTempest closed 2 years ago
@ChaoticTempest Looks cool. Let's fix the bug and merge.
@ChaoticTempest Looks like the deploy_js_contract ignore the initFunction. As we don't have the support to batch deploy and call init function in the same transaction, there're two choices here:
initFunction
option, let user call a near js call contract init ...
right after the deployinitFunction
, in deploy cmd, do deploy and call as two transactions@ailisp I don't think either of those options would guarantee us the safety of a batch transaction though unless point 2 is talking about that. JSVM should be able to schedule a promise that would allow us to do this deploy
with the initFunction
. But I get that it could take a while to implement and since our aim is June to release, we likely won't make it in time. I'll remove the init* related args and we can add it back in later
@ChaoticTempest Sounds good! It would be perfect if JSVM does that as a promise but you're right on timeline. Currently, if contract is building with sdk-js's @NearBindgen
then the contract would throw error, if it's not initialized and any contract method is called, that gives some level of security.
@ailisp @volovyk-s pushed view
and dev-deploy
here as well. Not sure how to implement view-state
since that requires more know-how about the enclave and doesn't seem like there's a specific call I can make that's exposed. But besides that, this PR should be ready to pull in
It looks very solid and all good on my side! But I'm not often in maintaining near-cli, so let @volovyk-s double check it fits near-cli well.
@ChaoticTempest we have working tests in master now. I will add them here.
Nice work @ChaoticTempest ! Merging now. Let's add some docs and examples from your doc to the README in the next PR.
Initial work on the JS cli command which includes:
Getting this one out for now to see if we want to move in this kind of direction before going on to adding more subcommands