| 378 | public: |
| 379 | wallet_api& self; |
| 380 | wallet_api_impl( wallet_api& s, const wallet_data& initial_data, fc::api<login_api> rapi ) |
| 381 | : self(s), |
| 382 | _chain_id(initial_data.chain_id), |
| 383 | _remote_api(rapi), |
| 384 | _remote_db(rapi->database()), |
| 385 | _remote_net_broadcast(rapi->network_broadcast()), |
| 386 | _remote_hist(rapi->history()) |
| 387 | { |
| 388 | chain_id_type remote_chain_id = _remote_db->get_chain_id(); |
| 389 | if( remote_chain_id != _chain_id ) |
| 390 | { |
| 391 | FC_THROW( "Remote server gave us an unexpected chain_id", |
| 392 | ("remote_chain_id", remote_chain_id) |
| 393 | ("chain_id", _chain_id) ); |
| 394 | } |
| 395 | init_prototype_ops(); |
| 396 | |
| 397 | _remote_db->set_block_applied_callback( [this](const variant& block_id ) |
| 398 | { |
| 399 | on_block_applied( block_id ); |
| 400 | } ); |
| 401 | |
| 402 | _wallet.chain_id = _chain_id; |
| 403 | _wallet.ws_server = initial_data.ws_server; |
| 404 | _wallet.ws_user = initial_data.ws_user; |
| 405 | _wallet.ws_password = initial_data.ws_password; |
| 406 | } |
| 407 | virtual ~wallet_api_impl() |
| 408 | { |
| 409 | try |
nothing calls this directly
no test coverage detected