Contracts: makes origination balance check inclusive

This commit is contained in:
Milo Davis 2017-08-28 15:07:14 +02:00 committed by Grégoire Henry
parent d255807af9
commit f2f4682606
2 changed files with 3 additions and 3 deletions

View File

@ -364,7 +364,7 @@ let originate c nonce ~balance ~manager ?script ~delegate ~spendable ~delegatabl
create c nonce ~balance ~manager ~delegate ?script ~spendable ~delegatable >>=? fun (c, contract, nonce) ->
(* check contract fee *)
contract_fee c contract >>=? fun fee ->
fail_unless Tez_repr.(balance > fee)
fail_unless Tez_repr.(balance >= fee)
(Initial_amount_too_low (contract, balance, fee)) >>=? fun () ->
return (c, contract, nonce)

View File

@ -39,7 +39,7 @@ let run blkid ({ b1 ; b2 ; _ } : Helpers.Account.bootstrap_accounts) =
~src:b1
~manager_pkh:foo.pkh
~spendable:true
~balance:100L () >>= fun result ->
~balance:99L () >>= fun result ->
Assert.initial_amount_too_low ~msg:__LOC__ result ;
(* Origination with amount > 1 tez *)
@ -47,7 +47,7 @@ let run blkid ({ b1 ; b2 ; _ } : Helpers.Account.bootstrap_accounts) =
~src:b1
~manager_pkh:foo.pkh
~spendable:true
~balance:101L () >>= fun _result ->
~balance:100L () >>= fun _result ->
(* TODO: test if new contract exists *)
(* Non-delegatable contract *)