@ -36,8 +36,6 @@
# include "TestHelper.h"
# include "webthreestubclient.h"
BOOST_AUTO_TEST_SUITE ( jsonrpc )
using namespace std ;
using namespace dev ;
using namespace dev : : eth ;
@ -46,20 +44,12 @@ namespace js = json_spirit;
namespace jsonrpc_tests
{
string name = " Ethereum(++) tests " ;
string dbPath ;
auto s = set < string > { " eth " , " shh " } ;
dev : : p2p : : NetworkPreferences np ( 30303 , std : : string ( ) , false ) ;
dev : : WebThreeDirect web3 ( name , dbPath , true , s , np ) ;
unique_ptr < WebThreeStubServer > jsonrpcServer ;
unique_ptr < WebThreeStubClient > jsonrpcClient ;
struct JsonrpcFixture {
JsonrpcFixture ( )
JsonrpcFixture ( ) : web3 ( name , dbPath , true , set < string > { " eth " , " shh " } , dev : : p2p : : NetworkPreferences ( 30303 , std : : string ( ) , false ) )
{
cnote < < " setup jsonrpc " ;
name = " Ethereum(++) tests " ;
web3 . setIdealPeerCount ( 5 ) ;
web3 . ethereum ( ) - > setForceMining ( true ) ;
jsonrpcServer = unique_ptr < WebThreeStubServer > ( new WebThreeStubServer ( new jsonrpc : : CorsHttpServer ( 8080 ) , web3 , { } ) ) ;
@ -72,9 +62,16 @@ struct JsonrpcFixture {
{
cnote < < " teardown jsonrpc " ;
}
string name ;
string dbPath ;
unique_ptr < WebThreeStubServer > jsonrpcServer ;
unique_ptr < WebThreeStubClient > jsonrpcClient ;
dev : : WebThreeDirect web3 ;
} ;
BOOST_GLOBAL_FIXTURE ( JsonrpcFixture )
BOOST_FIXTURE_TEST_SUIT E ( jsonrpc , JsonrpcFixture )
BOOST_AUTO_TEST_CASE ( jsonrpc_defaultBlock )
{
@ -242,9 +239,6 @@ BOOST_AUTO_TEST_CASE(jsonrpc_transact)
BOOST_CHECK_EQUAL ( jsToDecimal ( balanceString2 ) , " 750000000000000000 " ) ;
BOOST_CHECK_EQUAL ( txAmount , balance2 ) ;
}
BOOST_AUTO_TEST_SUITE_END ( )
}
BOOST_AUTO_TEST_SUITE_END ( )
# endif