Commit 8e6cba2c authored by 袁兴强's avatar 袁兴强

return 0 only if contract is successfully excuted

parent 25ce22c5
...@@ -103,11 +103,16 @@ func (w *Wasm) Exec_Call(payload *types2.WasmCall, tx *types.Transaction, index ...@@ -103,11 +103,16 @@ func (w *Wasm) Exec_Call(payload *types2.WasmCall, tx *types.Transaction, index
logs = append(logs, w.receiptLogs...) logs = append(logs, w.receiptLogs...)
return &types.Receipt{ receipt := &types.Receipt{
Ty: types.ExecOk, Ty: types.ExecOk,
KV: w.kvs, KV: w.kvs,
Logs: logs, Logs: logs,
}, nil }
if ret != 0 {
receipt.Ty = types.ExecPack
}
return receipt, nil
} }
func validateName(name string) bool { func validateName(name string) bool {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment