MCPcopy Create free account
hub / github.com/LUX-Core/lux / toTransactionSkeleton

Function toTransactionSkeleton

src/cpp-ethereum/libweb3jsonrpc/JsonHelper.cpp:354–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354TransactionSkeleton toTransactionSkeleton(Json::Value const& _json)
355{
356 TransactionSkeleton ret;
357 if (!_json.isObject() || _json.empty())
358 return ret;
359
360 if (!_json["from"].empty())
361 ret.from = jsToAddress(_json["from"].asString());
362 if (!_json["to"].empty() && _json["to"].asString() != "0x")
363 ret.to = jsToAddress(_json["to"].asString());
364 else
365 ret.creation = true;
366
367 if (!_json["value"].empty())
368 ret.value = jsToU256(_json["value"].asString());
369
370 if (!_json["gas"].empty())
371 ret.gas = jsToU256(_json["gas"].asString());
372
373 if (!_json["gasPrice"].empty())
374 ret.gasPrice = jsToU256(_json["gasPrice"].asString());
375
376 if (!_json["data"].empty()) // ethereum.js has preconstructed the data array
377 ret.data = jsToBytes(_json["data"].asString(), OnFailed::Throw);
378
379 if (!_json["code"].empty())
380 ret.data = jsToBytes(_json["code"].asString(), OnFailed::Throw);
381
382 if (!_json["nonce"].empty())
383 ret.nonce = jsToU256(_json["nonce"].asString());
384 return ret;
385}
386
387dev::eth::LogFilter toLogFilter(Json::Value const& _json)
388{

Callers 6

eth_sendTransactionMethod · 0.85
eth_signTransactionMethod · 0.85
eth_callMethod · 0.85
eth_estimateGasMethod · 0.85
debug_traceCallMethod · 0.85

Calls 5

jsToAddressFunction · 0.85
jsToU256Function · 0.85
jsToBytesFunction · 0.85
isObjectMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected