DeployHandler may need world write lock.
If DeployHandler may calls on_install or on_update. Before it
decompresses content, it doesn't know how it covers. It's reasonable
that it gets write lock for world.
@@ -72,6 +72,13 @@ func genContractAddr(from, timestamp, nonce []byte) []byte {
return addr
}
+func (h *DeployHandler) Prepare(wc WorldContext) (WorldContext, error) {
+ lq := []LockRequest{
+ {"", AccountWriteLock},
+ }
+ return wc.GetFuture(lq), nil
+}
+
func (h *DeployHandler) ExecuteSync(wc WorldContext) (module.Status, *big.Int,
*codec.TypedObj, module.Address,
) {
