| 352 | } |
| 353 | |
| 354 | TransactionSkeleton 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 | |
| 387 | dev::eth::LogFilter toLogFilter(Json::Value const& _json) |
| 388 | { |
no test coverage detected