Alpha: make origination cost for tz[123]s on par with KT1s

This commit is contained in:
Benjamin Canou 2018-11-21 19:21:59 +01:00 committed by Pierre Boutillier
parent 09e3881c6b
commit a991396e10
No known key found for this signature in database
GPG Key ID: C2F73508B56A193C

View File

@ -373,6 +373,15 @@ let apply_manager_operation_content :
(ctxt, (Reveal_result : kind successful_manager_operation_result), []) (ctxt, (Reveal_result : kind successful_manager_operation_result), [])
| Transaction { amount ; parameters ; destination } -> begin | Transaction { amount ; parameters ; destination } -> begin
spend ctxt source amount >>=? fun ctxt -> spend ctxt source amount >>=? fun ctxt ->
begin match Contract.is_implicit destination with
| None -> return (ctxt, [])
| Some _ ->
Contract.allocated ctxt destination >>=? function
| true -> return (ctxt, [])
| false ->
Fees.origination_burn ctxt ~payer >>=? fun (ctxt, orignation_burn) ->
return (ctxt, [ Delegate.Contract payer, Delegate.Debited orignation_burn ])
end >>=? fun (ctxt, maybe_burn_balance_update) ->
Contract.credit ctxt destination amount >>=? fun ctxt -> Contract.credit ctxt destination amount >>=? fun ctxt ->
Contract.get_script ctxt destination >>=? fun (ctxt, script) -> Contract.get_script ctxt destination >>=? fun (ctxt, script) ->
match script with match script with
@ -398,8 +407,9 @@ let apply_manager_operation_content :
big_map_diff = None; big_map_diff = None;
balance_updates = balance_updates =
Delegate.cleanup_balance_updates Delegate.cleanup_balance_updates
[ Contract source, Debited amount ; ([ Delegate.Contract source, Delegate.Debited amount ;
Contract destination, Credited amount ] ; Contract destination, Credited amount ]
@ maybe_burn_balance_update) ;
originated_contracts = [] ; originated_contracts = [] ;
consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt ; consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt ;
storage_size = Z.zero ; storage_size = Z.zero ;