From 1ec8db725e9dac7e27b57146502cf6dcec7f78d5 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 23 Jul 2015 16:11:48 +0200 Subject: [PATCH 01/15] fixed more tests --- TestHelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TestHelper.cpp b/TestHelper.cpp index aec72285c..d7c8d3333 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -79,7 +79,7 @@ void mine(Ethash::BlockHeader& _bi) sealer->onSealGenerated([&](bytes const& sealedHeader){ sealed = sealedHeader; }); sealer->generateSeal(_bi); sealed.waitNot({}); - _bi = Ethash::BlockHeader(sealed); + _bi = Ethash::BlockHeader(sealed, IgnoreSeal, h256{}, HeaderData); } } @@ -841,7 +841,7 @@ dev::eth::Ethash::BlockHeader constructHeader( rlpStream << _parentHash << _sha3Uncles << _coinbaseAddress << _stateRoot << _transactionsRoot << _receiptsRoot << _logBloom << _difficulty << _number << _gasLimit << _gasUsed << _timestamp << _extraData << h256{} << Nonce{}; - return Ethash::BlockHeader(rlpStream.out()); + return Ethash::BlockHeader(rlpStream.out(), IgnoreSeal, h256{}, HeaderData); } void updateEthashSeal(dev::eth::Ethash::BlockHeader& _header, h256 const& _mixHash, dev::eth::Nonce const& _nonce) @@ -855,7 +855,7 @@ void updateEthashSeal(dev::eth::Ethash::BlockHeader& _header, h256 const& _mixHa header << sourceRlp[i]; header << _mixHash << _nonce; - _header = Ethash::BlockHeader(header.out()); + _header = Ethash::BlockHeader(header.out(), IgnoreSeal, h256{}, HeaderData); } namespace From 35cb53ad2e9690d7cb9521a135b8ea5f68207d0d Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 23 Jul 2015 23:44:35 +0200 Subject: [PATCH 02/15] Revoke tests. --- libsolidity/SolidityWallet.cpp | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/libsolidity/SolidityWallet.cpp b/libsolidity/SolidityWallet.cpp index d87edd359..3c88afd95 100644 --- a/libsolidity/SolidityWallet.cpp +++ b/libsolidity/SolidityWallet.cpp @@ -559,6 +559,62 @@ BOOST_AUTO_TEST_CASE(multisig_value_transfer) BOOST_CHECK_EQUAL(m_state.balance(Address(0x05)), 100); } +BOOST_AUTO_TEST_CASE(revoke_addOwner) +{ + deployWallet(); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x12)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x13)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x14)) == encodeArgs()); + // 4 owners, set required to 3 + BOOST_REQUIRE(callContractFunction("changeRequirement(uint256)", u256(3)) == encodeArgs()); + // add a new owner + Address deployer = m_sender; + h256 opHash = sha3(FixedHash<4>(dev::sha3("addOwner(address)")).asBytes() + h256(0x33).asBytes()); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x33)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("isOwner(address)", h256(0x33)) == encodeArgs(false)); + m_sender = Address(0x12); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x33)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("isOwner(address)", h256(0x33)) == encodeArgs(false)); + // revoke one confirmation + m_sender = deployer; + BOOST_REQUIRE(callContractFunction("revoke(bytes32)", opHash) == encodeArgs()); + m_sender = Address(0x13); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x33)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("isOwner(address)", h256(0x33)) == encodeArgs(false)); + m_sender = Address(0x14); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x33)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("isOwner(address)", h256(0x33)) == encodeArgs(true)); +} + +BOOST_AUTO_TEST_CASE(revoke_transaction) +{ + deployWallet(200); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x12)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x13)) == encodeArgs()); + BOOST_REQUIRE(callContractFunction("addOwner(address)", h256(0x14)) == encodeArgs()); + // 4 owners, set required to 3 + BOOST_REQUIRE(callContractFunction("changeRequirement(uint256)", u256(3)) == encodeArgs()); + // create a transaction + Address deployer = m_sender; + h256 opHash("8f27f478ebcfaf28b0c354f4809ace8087000d668b89c8bc3b1b608bfdbe6654"); + BOOST_CHECK_EQUAL(m_state.balance(Address(0x05)), 0); + m_sender = Address(0x12); + BOOST_REQUIRE(callContractFunction("execute(address,uint256,bytes)", h256(0x05), 100, 0x60, 0x00) == encodeArgs(opHash)); + BOOST_CHECK_EQUAL(m_state.balance(Address(0x05)), 0); + m_sender = Address(0x13); + BOOST_REQUIRE(callContractFunction("execute(address,uint256,bytes)", h256(0x05), 100, 0x60, 0x00) == encodeArgs(opHash)); + BOOST_CHECK_EQUAL(m_state.balance(Address(0x05)), 0); + m_sender = Address(0x12); + BOOST_REQUIRE(callContractFunction("revoke(bytes32)", opHash) == encodeArgs()); + m_sender = deployer; + BOOST_REQUIRE(callContractFunction("execute(address,uint256,bytes)", h256(0x05), 100, 0x60, 0x00) == encodeArgs(opHash)); + BOOST_CHECK_EQUAL(m_state.balance(Address(0x05)), 0); + m_sender = Address(0x14); + BOOST_REQUIRE(callContractFunction("execute(address,uint256,bytes)", h256(0x05), 100, 0x60, 0x00) == encodeArgs(opHash)); + // now it should go through + BOOST_CHECK_EQUAL(m_state.balance(Address(0x05)), 100); +} + BOOST_AUTO_TEST_CASE(daylimit) { deployWallet(200); From 53a47330dc3eda8db542b268ba0122b0590aa499 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Wed, 22 Jul 2015 01:34:45 +0200 Subject: [PATCH 03/15] first version From c2663f458801bcd56a6666f9a5032739b0cfbd61 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Wed, 22 Jul 2015 16:57:09 +0200 Subject: [PATCH 04/15] saving & restoring topics From ced54832b6446610a3d3d7558b02650245f60cca Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Fri, 24 Jul 2015 01:32:31 +0200 Subject: [PATCH 05/15] WhisperDB class split From 78180933c5a9ceb5032ea0189d769922ec5d1567 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Fri, 24 Jul 2015 14:50:27 +0200 Subject: [PATCH 06/15] moved some fucntions to WhsiperDB class From 14f54abeec1eca17d6d435bd72eb4673c48e2ee2 Mon Sep 17 00:00:00 2001 From: arkpar Date: Fri, 24 Jul 2015 17:58:34 +0200 Subject: [PATCH 07/15] fixing tests From 01a30b019706d91731a28e23bd86908d197b70e7 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Fri, 24 Jul 2015 18:22:18 +0200 Subject: [PATCH 08/15] refactoring From fb83d5440e11b21e0235df18a5c9c736a692ecc6 Mon Sep 17 00:00:00 2001 From: arkpar Date: Fri, 24 Jul 2015 19:53:23 +0200 Subject: [PATCH 09/15] more tests fixed --- TestHelper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TestHelper.cpp b/TestHelper.cpp index d7c8d3333..ab9a17495 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -69,6 +69,7 @@ void mine(State& s, BlockChain const& _bc) sealer->onSealGenerated([&](bytes const& sealedHeader){ sealed = sealedHeader; }); sealer->generateSeal(s.info()); sealed.waitNot({}); + sealer.reset(); s.sealBlock(sealed); } @@ -79,6 +80,7 @@ void mine(Ethash::BlockHeader& _bi) sealer->onSealGenerated([&](bytes const& sealedHeader){ sealed = sealedHeader; }); sealer->generateSeal(_bi); sealed.waitNot({}); + sealer.reset(); _bi = Ethash::BlockHeader(sealed, IgnoreSeal, h256{}, HeaderData); } From 795037215b52be5a4c847f9ddc2e69aa62894e8e Mon Sep 17 00:00:00 2001 From: arkpar Date: Fri, 24 Jul 2015 20:21:43 +0200 Subject: [PATCH 10/15] fixed gaspricer test From 2a09f087e9013a96a2b005834f21937ce56d944c Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Fri, 24 Jul 2015 20:44:27 +0200 Subject: [PATCH 11/15] test ports changed From 5843bb16ba4a7e61a146c4aa681d7924ba1bdbf3 Mon Sep 17 00:00:00 2001 From: subtly Date: Fri, 24 Jul 2015 15:15:27 -0400 Subject: [PATCH 12/15] update secp256k1 From 8cd57ddda53b42b25093fe460f3686ee5c9951d5 Mon Sep 17 00:00:00 2001 From: subtly Date: Sat, 25 Jul 2015 04:50:13 -0400 Subject: [PATCH 13/15] Update txq test for deterministic signature output of updated secp256k1. From 19afead1f36faed6df0efcf53e1f149cf3a628b3 Mon Sep 17 00:00:00 2001 From: subtly Date: Sat, 25 Jul 2015 05:52:41 -0400 Subject: [PATCH 14/15] remove unused code From bf6747ff868c2c3783e7882efdc2c767df52fa95 Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 26 Jul 2015 14:28:14 -0400 Subject: [PATCH 15/15] re-disable secp256k1 on windows --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bdefd65e..6e24e3347 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,9 @@ target_link_libraries(testeth ${CURL_LIBRARIES}) target_link_libraries(testeth ${CRYPTOPP_LIBRARIES}) target_link_libraries(testeth ethereum) target_link_libraries(testeth ethcore) -target_link_libraries(testeth secp256k1) +if (NOT WIN32) + target_link_libraries(testeth secp256k1) +endif () if (JSCONSOLE) target_link_libraries(testeth jsengine)