| 298 | } |
| 299 | |
| 300 | FunctionValue TestFileParser::parseFunctionCallValue() |
| 301 | { |
| 302 | try |
| 303 | { |
| 304 | u256 value{ parseDecimalNumber() }; |
| 305 | Token token = m_scanner.currentToken(); |
| 306 | if (token != Token::Ether && token != Token::Wei) |
| 307 | BOOST_THROW_EXCEPTION(TestParserError("Invalid value unit provided. Coins can be wei or ether.")); |
| 308 | |
| 309 | m_scanner.scanNextToken(); |
| 310 | |
| 311 | FunctionValueUnit unit = token == Token::Wei ? FunctionValueUnit::Wei : FunctionValueUnit::Ether; |
| 312 | return { (unit == FunctionValueUnit::Wei ? u256(1) : exp256(u256(10), u256(18))) * value, unit }; |
| 313 | } |
| 314 | catch (std::exception const&) |
| 315 | { |
| 316 | BOOST_THROW_EXCEPTION(TestParserError("Ether value encoding invalid.")); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | FunctionCallArgs TestFileParser::parseFunctionCallArguments() |
| 321 | { |
nothing calls this directly
no test coverage detected