diff --git a/src/proto/alpha/contract_storage.ml b/src/proto/alpha/contract_storage.ml index bd9e5cbf0..17744cc52 100644 --- a/src/proto/alpha/contract_storage.ml +++ b/src/proto/alpha/contract_storage.ml @@ -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) diff --git a/test/proto_alpha/test_origination.ml b/test/proto_alpha/test_origination.ml index 5fe27f1db..b57ecf9da 100644 --- a/test/proto_alpha/test_origination.ml +++ b/test/proto_alpha/test_origination.ml @@ -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 *)