diff options
author | chriseth <c@ethdev.com> | 2015-06-17 22:35:28 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-06-18 17:38:14 +0800 |
commit | 8603d0c73424f37881f65d2ed333a73f760e92d0 (patch) | |
tree | 2b3a552ccca7e570136ff35daa1ee2f73fe91929 | |
parent | 5185b75adddcbbabdf162bc1734121a146224558 (diff) | |
download | dexon-solidity-8603d0c73424f37881f65d2ed333a73f760e92d0.tar.gz dexon-solidity-8603d0c73424f37881f65d2ed333a73f760e92d0.tar.zst dexon-solidity-8603d0c73424f37881f65d2ed333a73f760e92d0.zip |
Fix to correctly write nonce during tests.
-rw-r--r-- | TestUtils.cpp | 11 | ||||
-rw-r--r-- | TestUtils.h | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/TestUtils.cpp b/TestUtils.cpp index ff5169d5..bd603a61 100644 --- a/TestUtils.cpp +++ b/TestUtils.cpp @@ -22,6 +22,7 @@ #include <thread> #include <boost/test/unit_test.hpp> #include <boost/filesystem.hpp> +#include <libdevcrypto/Common.h> #include <libtestutils/Common.h> #include <libtestutils/BlockChainLoader.h> #include <libtestutils/FixedClient.h> @@ -116,3 +117,13 @@ void ParallelClientBaseFixture::enumerateClients(std::function<void(Json::Value }); }); } + +MoveNonceToTempDir::MoveNonceToTempDir() +{ + crypto::Nonce::setSeedFilePath(m_dir.path() + "/seed"); +} + +MoveNonceToTempDir::~MoveNonceToTempDir() +{ + crypto::Nonce::reset(); +} diff --git a/TestUtils.h b/TestUtils.h index f9817c21..94558635 100644 --- a/TestUtils.h +++ b/TestUtils.h @@ -24,6 +24,7 @@ #include <functional> #include <string> #include <json/json.h> +#include <libdevcore/TransientDirectory.h> #include <libethereum/BlockChain.h> #include <libethereum/ClientBase.h> @@ -78,5 +79,13 @@ struct JsonRpcFixture: public ClientBaseFixture }; +struct MoveNonceToTempDir +{ + MoveNonceToTempDir(); + ~MoveNonceToTempDir(); +private: + TransientDirectory m_dir; +}; + } } |