Right now, we implement some optimizations when a code is uploaded and instantiation at the same time. That adds a lot of complexity to our code. The right move would be to only support instantiate and upload_code and let users use batch_all if they want to bundle them. It would massively simplify our code.
That said, we can't remove the instantiate_with_code dispatchable for backwards compatibility. But we can refactor it to just emulate batch_all by doing upload_code and instantiate back to back in a storage transaction.
Right now, we implement some optimizations when a code is uploaded and instantiation at the same time. That adds a lot of complexity to our code. The right move would be to only support
instantiate
andupload_code
and let users usebatch_all
if they want to bundle them. It would massively simplify our code.That said, we can't remove the
instantiate_with_code
dispatchable for backwards compatibility. But we can refactor it to just emulatebatch_all
by doingupload_code
andinstantiate
back to back in a storage transaction.