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

Method eth_sendTransaction

src/cpp-ethereum/libweb3jsonrpc/Eth.cpp:256–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256string Eth::eth_sendTransaction(Json::Value const& _json)
257{
258 try
259 {
260 TransactionSkeleton t = toTransactionSkeleton(_json);
261 setTransactionDefaults(t);
262 TransactionNotification n = m_ethAccounts.authenticate(t);
263 switch (n.r)
264 {
265 case TransactionRepercussion::Success:
266 return toJS(n.hash);
267 case TransactionRepercussion::ProxySuccess:
268 return toJS(n.hash);// TODO: give back something more useful than an empty hash.
269 case TransactionRepercussion::UnknownAccount:
270 BOOST_THROW_EXCEPTION(JsonRpcException("Account unknown."));
271 case TransactionRepercussion::Locked:
272 BOOST_THROW_EXCEPTION(JsonRpcException("Account is locked."));
273 case TransactionRepercussion::Refused:
274 BOOST_THROW_EXCEPTION(JsonRpcException("Transaction rejected by user."));
275 case TransactionRepercussion::Unknown:
276 BOOST_THROW_EXCEPTION(JsonRpcException("Unknown reason."));
277 }
278 }
279 catch (JsonRpcException&)
280 {
281 throw;
282 }
283 catch (...)
284 {
285 BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
286 }
287 BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
288 return string();
289}
290
291string Eth::eth_signTransaction(Json::Value const& _json)
292{

Callers 1

eth_sendTransactionIMethod · 0.45

Calls 3

toTransactionSkeletonFunction · 0.85
toJSFunction · 0.85
authenticateMethod · 0.45

Tested by

no test coverage detected