Alpha: take origination burn from source and not destination.

This commit is contained in:
Benjamin Canou 2017-03-20 14:37:01 +01:00 committed by Grégoire Henry
parent 02a67a7976
commit 2ed66ea569

View File

@ -85,11 +85,11 @@ let apply_manager_operation_content ctxt origination_nonce accept_failing_script
| None -> None | None -> None
| Some script -> | Some script ->
Some (script, (Script_interpreter.dummy_code_fee, Script_interpreter.dummy_storage_fee)) in Some (script, (Script_interpreter.dummy_code_fee, Script_interpreter.dummy_storage_fee)) in
Contract.spend ctxt source Constants.origination_burn >>=? fun ctxt ->
Contract.spend ctxt source credit >>=? fun ctxt -> Contract.spend ctxt source credit >>=? fun ctxt ->
Lwt.return Tez.(credit -? Constants.origination_burn) >>=? fun balance ->
Contract.originate ctxt Contract.originate ctxt
origination_nonce origination_nonce
~manager ~delegate ~balance ~manager ~delegate ~balance:credit
?script ?script
~spendable ~delegatable >>=? fun (ctxt, _, origination_nonce) -> ~spendable ~delegatable >>=? fun (ctxt, _, origination_nonce) ->
return (ctxt, origination_nonce) return (ctxt, origination_nonce)