mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #454 from jorisbontje/423-dockerfile
update Dockerfile with cryptopp and jsonrpc dependencies, fixes #423 Cleaned up jsonrpc test Forgot the #if Undo jsonrpc test changes
This commit is contained in:
		
							parent
							
								
									919d3c56eb
								
							
						
					
					
						commit
						37939c565d
					
				
							
								
								
									
										28
									
								
								jsonrpc.cpp
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								jsonrpc.cpp
									
									
									
									
									
								
							| @ -36,6 +36,8 @@ | ||||
| #include "TestHelper.h" | ||||
| #include "webthreestubclient.h" | ||||
| 
 | ||||
| BOOST_AUTO_TEST_SUITE(jsonrpc) | ||||
| 
 | ||||
| using namespace std; | ||||
| using namespace dev; | ||||
| using namespace dev::eth; | ||||
| @ -44,12 +46,20 @@ 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():web3(name, dbPath, true, set<string>{"eth", "shh"}, dev::p2p::NetworkPreferences(30303, std::string(), false)) | ||||
| 	JsonrpcFixture() | ||||
| 	{ | ||||
| 		cnote << "setup jsonrpc"; | ||||
| 
 | ||||
| 		name = "Ethereum(++) tests"; | ||||
| 		web3.setIdealPeerCount(5); | ||||
| 		web3.ethereum()->setForceMining(true); | ||||
| 		jsonrpcServer = unique_ptr<WebThreeStubServer>(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3, {})); | ||||
| @ -62,16 +72,9 @@ struct JsonrpcFixture  { | ||||
| 	{ | ||||
| 		cnote << "teardown jsonrpc"; | ||||
| 	} | ||||
| 
 | ||||
| 	string name; | ||||
| 	string dbPath; | ||||
| 	unique_ptr<WebThreeStubServer> jsonrpcServer; | ||||
| 	unique_ptr<WebThreeStubClient> jsonrpcClient; | ||||
| 	dev::WebThreeDirect web3; | ||||
| 
 | ||||
| }; | ||||
| 
 | ||||
| BOOST_FIXTURE_TEST_SUITE(jsonrpc, JsonrpcFixture) | ||||
| BOOST_GLOBAL_FIXTURE(JsonrpcFixture) | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(jsonrpc_defaultBlock) | ||||
| { | ||||
| @ -239,6 +242,9 @@ 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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user