mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adds constructor calls with ether value to isoltest.
This commit is contained in:
parent
579bdaddb9
commit
e269a0ff70
@ -80,7 +80,7 @@ TestCase::TestResult SemanticTest::run(ostream& _stream, string const& _linePref
|
|||||||
{
|
{
|
||||||
if (&test == &m_tests.front())
|
if (&test == &m_tests.front())
|
||||||
if (test.call().isConstructor)
|
if (test.call().isConstructor)
|
||||||
deploy("", 0, test.call().arguments.rawBytes());
|
deploy("", test.call().value, test.call().arguments.rawBytes());
|
||||||
else
|
else
|
||||||
soltestAssert(deploy("", 0, bytes()), "Failed to deploy contract.");
|
soltestAssert(deploy("", 0, bytes()), "Failed to deploy contract.");
|
||||||
else
|
else
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
contract C {
|
contract C {
|
||||||
uint public state = 0;
|
uint public state = 0;
|
||||||
constructor(uint _state) public {
|
constructor(uint _state) public payable {
|
||||||
state = _state;
|
state = _state;
|
||||||
}
|
}
|
||||||
|
function balance() payable public returns (uint256) {
|
||||||
|
return address(this).balance;
|
||||||
|
}
|
||||||
function f() payable public returns (uint) {
|
function f() payable public returns (uint) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@ -38,8 +41,9 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// constructor(): 3 ->
|
// constructor(), 2 ether: 3 ->
|
||||||
// state() -> 3
|
// state() -> 3
|
||||||
|
// balance() -> 2
|
||||||
// _() -> FAILURE
|
// _() -> FAILURE
|
||||||
// f() -> 2
|
// f() -> 2
|
||||||
// f(), 1 ether -> 2
|
// f(), 1 ether -> 2
|
||||||
|
Loading…
Reference in New Issue
Block a user