diff --git a/libethereum/ClientBase.h b/libethereum/ClientBase.h index 96f769b5f..2790b4ee3 100644 --- a/libethereum/ClientBase.h +++ b/libethereum/ClientBase.h @@ -120,6 +120,7 @@ class ClientBase : public Interface { using Interface::blockInfo; // for another overload using Interface::transactionHashes; using Interface::uncle; + using Interface::uncleCount; using Interface::uncleHashes; h256 hashFromNumber( BlockNumber _number ) const override; @@ -152,7 +153,6 @@ class ClientBase : public Interface { } return transactionCount( hashFromNumber( _block ) ); } - using Interface::uncleCount; unsigned uncleCount( h256 _blockHash ) const override; unsigned number() const override; h256s pendingHashes() const override; diff --git a/test/unittests/libethereum/ClientTest.cpp b/test/unittests/libethereum/ClientTest.cpp index ed9bdb878..9cc2e0b93 100644 --- a/test/unittests/libethereum/ClientTest.cpp +++ b/test/unittests/libethereum/ClientTest.cpp @@ -39,7 +39,7 @@ using namespace dev::test; using namespace dev::p2p; namespace fs = boost::filesystem; -static size_t rand_port = 1024 + rand() % 64000; +static size_t rand_port = ( srand(time(nullptr)), 1024 + rand() % 64000 ); struct FixtureCommon { const string BTRFS_FILE_PATH = "btrfs.file"; diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index c004aaf6d..5bb027f68 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -380,7 +380,8 @@ JsonRpcFixture( const std::string& _config = "", bool _owner = true, serverOpts.netOpts_.bindOptsStandard_.cntServers_ = 1; serverOpts.netOpts_.bindOptsStandard_.strAddrHTTP4_ = chainParams.nodeInfo.ip; // random port - serverOpts.netOpts_.bindOptsStandard_.nBasePortHTTP4_ = std::rand() % 64000 + 1025; + // +3 because rand() seems to be called effectively simultaneously here and in "static" section - thus giving same port for consensus + serverOpts.netOpts_.bindOptsStandard_.nBasePortHTTP4_ = std::rand() % 64000 + 1025 + 3; std::cout << "PORT: " << serverOpts.netOpts_.bindOptsStandard_.nBasePortHTTP4_ << std::endl; skale_server_connector = new SkaleServerOverride( chainParams, client.get(), serverOpts ); rpcServer->addConnector( skale_server_connector ); @@ -846,7 +847,7 @@ BOOST_AUTO_TEST_CASE( simple_contract ) { // } // } - string compiled = + string compiled = "608060405234801561001057600080fd5b506101ef8061002060003" "96000f3fe608060405234801561001057600080fd5b506004361061" "00365760003560e01c8063552410771461003b578063b3de648b146" @@ -4075,7 +4076,7 @@ BOOST_AUTO_TEST_CASE( cached_filestorage ) { auto _config = c_genesisConfigString; Json::Value ret; Json::Reader().parse( _config, ret ); - ret["skaleConfig"]["sChain"]["revertableFSPatchTimestamp"] = 1; + ret["skaleConfig"]["sChain"]["revertableFSPatchTimestamp"] = 1; Json::FastWriter fastWriter; std::string config = fastWriter.write( ret ); RestrictedAddressFixture fixture( config );