MCPcopy Create free account
hub / github.com/argotorg/solidity / parseFunctionCallValue

Method parseFunctionCallValue

test/libsolidity/util/TestFileParser.cpp:300–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300FunctionValue 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
320FunctionCallArgs TestFileParser::parseFunctionCallArguments()
321{

Callers

nothing calls this directly

Calls 4

TestParserErrorClass · 0.85
exp256Function · 0.85
scanNextTokenMethod · 0.80
currentTokenMethod · 0.45

Tested by

no test coverage detected