Contracts: makes origination balance check inclusive
This commit is contained in:
parent
d255807af9
commit
f2f4682606
@ -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) ->
|
create c nonce ~balance ~manager ~delegate ?script ~spendable ~delegatable >>=? fun (c, contract, nonce) ->
|
||||||
(* check contract fee *)
|
(* check contract fee *)
|
||||||
contract_fee c contract >>=? fun 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 () ->
|
(Initial_amount_too_low (contract, balance, fee)) >>=? fun () ->
|
||||||
return (c, contract, nonce)
|
return (c, contract, nonce)
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ let run blkid ({ b1 ; b2 ; _ } : Helpers.Account.bootstrap_accounts) =
|
|||||||
~src:b1
|
~src:b1
|
||||||
~manager_pkh:foo.pkh
|
~manager_pkh:foo.pkh
|
||||||
~spendable:true
|
~spendable:true
|
||||||
~balance:100L () >>= fun result ->
|
~balance:99L () >>= fun result ->
|
||||||
Assert.initial_amount_too_low ~msg:__LOC__ result ;
|
Assert.initial_amount_too_low ~msg:__LOC__ result ;
|
||||||
|
|
||||||
(* Origination with amount > 1 tez *)
|
(* Origination with amount > 1 tez *)
|
||||||
@ -47,7 +47,7 @@ let run blkid ({ b1 ; b2 ; _ } : Helpers.Account.bootstrap_accounts) =
|
|||||||
~src:b1
|
~src:b1
|
||||||
~manager_pkh:foo.pkh
|
~manager_pkh:foo.pkh
|
||||||
~spendable:true
|
~spendable:true
|
||||||
~balance:101L () >>= fun _result ->
|
~balance:100L () >>= fun _result ->
|
||||||
(* TODO: test if new contract exists *)
|
(* TODO: test if new contract exists *)
|
||||||
|
|
||||||
(* Non-delegatable contract *)
|
(* Non-delegatable contract *)
|
||||||
|
Loading…
Reference in New Issue
Block a user