aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-24 03:51:03 +0800
committerGitHub <noreply@github.com>2017-10-24 03:51:03 +0800
commit6f4220ef55db331f3ee4422c1d92d4485fb1a4e6 (patch)
tree8f2cf75c6410aed0cb72316ac637c85ad92f30a0 /test
parent31318305f3da0296cd31fedfe0512037a4b901c2 (diff)
parentdcbcd36be79df439d08c7ed3441eb498225dd68d (diff)
downloaddexon-solidity-6f4220ef55db331f3ee4422c1d92d4485fb1a4e6.tar
dexon-solidity-6f4220ef55db331f3ee4422c1d92d4485fb1a4e6.tar.gz
dexon-solidity-6f4220ef55db331f3ee4422c1d92d4485fb1a4e6.tar.bz2
dexon-solidity-6f4220ef55db331f3ee4422c1d92d4485fb1a4e6.tar.lz
dexon-solidity-6f4220ef55db331f3ee4422c1d92d4485fb1a4e6.tar.xz
dexon-solidity-6f4220ef55db331f3ee4422c1d92d4485fb1a4e6.tar.zst
dexon-solidity-6f4220ef55db331f3ee4422c1d92d4485fb1a4e6.zip
Merge pull request #3117 from ethereum/wallet-test
Do not use the precompile address 0x05 in the wallet tests
Diffstat (limited to 'test')
-rw-r--r--test/contracts/Wallet.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp
index bbe603d4..90334ad6 100644
--- a/test/contracts/Wallet.cpp
+++ b/test/contracts/Wallet.cpp
@@ -559,24 +559,24 @@ BOOST_AUTO_TEST_CASE(multisig_value_transfer)
BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(account(3), h256::AlignRight)) == encodeArgs());
// 4 owners, set required to 3
BOOST_REQUIRE(callContractFunction("changeRequirement(uint256)", u256(3)) == encodeArgs());
- // check that balance is and stays zero at destination address
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ Address destination = Address("0x5c6d6026d3fb35cd7175fd0054ae8df50d8f8b41");
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
m_sender = account(0);
sendEther(account(1), 10 * ether);
m_sender = account(1);
- auto ophash = callContractFunction("execute(address,uint256,bytes)", h256(0x05), 100, 0x60, 0x00);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ auto ophash = callContractFunction("execute(address,uint256,bytes)", h256(destination, h256::AlignRight), 100, 0x60, 0x00);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
m_sender = account(0);
sendEther(account(2), 10 * ether);
m_sender = account(2);
callContractFunction("confirm(bytes32)", ophash);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
m_sender = account(0);
sendEther(account(3), 10 * ether);
m_sender = account(3);
callContractFunction("confirm(bytes32)", ophash);
// now it should go through
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 100);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 100);
}
BOOST_AUTO_TEST_CASE(revoke_addOwner)
@@ -622,30 +622,31 @@ BOOST_AUTO_TEST_CASE(revoke_transaction)
BOOST_REQUIRE(callContractFunction("changeRequirement(uint256)", u256(3)) == encodeArgs());
// create a transaction
Address deployer = m_sender;
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ Address destination = Address("0x5c6d6026d3fb35cd7175fd0054ae8df50d8f8b41");
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
m_sender = account(0);
sendEther(account(1), 10 * ether);
m_sender = account(1);
- auto opHash = callContractFunction("execute(address,uint256,bytes)", h256(0x05), 100, 0x60, 0x00);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ auto opHash = callContractFunction("execute(address,uint256,bytes)", h256(destination, h256::AlignRight), 100, 0x60, 0x00);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
m_sender = account(0);
sendEther(account(2), 10 * ether);
m_sender = account(2);
callContractFunction("confirm(bytes32)", opHash);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
m_sender = account(0);
sendEther(account(1), 10 * ether);
m_sender = account(1);
BOOST_REQUIRE(callContractFunction("revoke(bytes32)", opHash) == encodeArgs());
m_sender = deployer;
callContractFunction("confirm(bytes32)", opHash);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
m_sender = account(0);
sendEther(account(3), 10 * ether);
m_sender = account(3);
callContractFunction("confirm(bytes32)", opHash);
// now it should go through
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 100);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 100);
}
BOOST_AUTO_TEST_CASE(daylimit)
@@ -661,31 +662,32 @@ BOOST_AUTO_TEST_CASE(daylimit)
BOOST_REQUIRE(callContractFunction("changeRequirement(uint256)", u256(3)) == encodeArgs());
// try to send tx over daylimit
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ Address destination = Address("0x5c6d6026d3fb35cd7175fd0054ae8df50d8f8b41");
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
sendEther(account(1), 10 * ether);
m_sender = account(1);
BOOST_REQUIRE(
- callContractFunction("execute(address,uint256,bytes)", h256(0x05), 150, 0x60, 0x00) !=
+ callContractFunction("execute(address,uint256,bytes)", h256(destination, h256::AlignRight), 150, 0x60, 0x00) !=
encodeArgs(u256(0))
);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
// try to send tx under daylimit by stranger
m_sender = account(0);
sendEther(account(4), 10 * ether);
m_sender = account(4);
BOOST_REQUIRE(
- callContractFunction("execute(address,uint256,bytes)", h256(0x05), 90, 0x60, 0x00) ==
+ callContractFunction("execute(address,uint256,bytes)", h256(destination, h256::AlignRight), 90, 0x60, 0x00) ==
encodeArgs(u256(0))
);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 0);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 0);
// now send below limit by owner
m_sender = account(0);
sendEther(account(1), 10 * ether);
BOOST_REQUIRE(
- callContractFunction("execute(address,uint256,bytes)", h256(0x05), 90, 0x60, 0x00) ==
+ callContractFunction("execute(address,uint256,bytes)", h256(destination, h256::AlignRight), 90, 0x60, 0x00) ==
encodeArgs(u256(0))
);
- BOOST_CHECK_EQUAL(balanceAt(Address(0x05)), 90);
+ BOOST_CHECK_EQUAL(balanceAt(destination), 90);
}
BOOST_AUTO_TEST_CASE(daylimit_constructor)