mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Small issues with Canonical Function Signature
- Also added an extra test
This commit is contained in:
		
							parent
							
								
									36e5b5102a
								
							
						
					
					
						commit
						deb137f2c4
					
				| @ -336,7 +336,24 @@ BOOST_AUTO_TEST_CASE(function_canonical_signature) | ||||
| 		if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get())) | ||||
| 		{ | ||||
| 			auto functions = contract->getDefinedFunctions(); | ||||
| 			BOOST_ASSERT("foo(uint256,uint64,bool)" == functions[0]->getCanonicalSignature()); | ||||
| 			BOOST_CHECK_EQUAL("foo(uint256,uint64,bool)", functions[0]->getCanonicalSignature()); | ||||
| 		} | ||||
| } | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(function_canonical_signature_type_aliases) | ||||
| { | ||||
| 	ASTPointer<SourceUnit> sourceUnit; | ||||
| 	char const* text = "contract Test {\n" | ||||
| 					   "  function boo(uint arg1, hash arg2, address arg3) returns (uint ret) {\n" | ||||
| 					   "    ret = 5;\n" | ||||
| 					   "  }\n" | ||||
| 					   "}\n"; | ||||
| 	BOOST_CHECK_NO_THROW(sourceUnit = parseTextAndResolveNames(text)); | ||||
| 	for (ASTPointer<ASTNode> const& node: sourceUnit->getNodes()) | ||||
| 		if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get())) | ||||
| 		{ | ||||
| 			auto functions = contract->getDefinedFunctions(); | ||||
| 			BOOST_CHECK_EQUAL("boo(uint256,hash256,address)", functions[0]->getCanonicalSignature()); | ||||
| 		} | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user