diff --git a/src/cli/subcommands/mpool_cmd.rs b/src/cli/subcommands/mpool_cmd.rs index 940adf607984..eceeae8f8416 100644 --- a/src/cli/subcommands/mpool_cmd.rs +++ b/src/cli/subcommands/mpool_cmd.rs @@ -4,7 +4,11 @@ use std::str::FromStr; use crate::blocks::Tipset; +use crate::lotus_json::LotusJson; use crate::message::SignedMessage; +use crate::rpc::mpool_api::MpoolPending; +use crate::rpc::types::ApiTipsetKey; +use crate::rpc::{self, RpcMethodExt as _}; use crate::rpc_client::ApiInfo; use crate::shim::address::StrictAddress; use crate::shim::message::Message; @@ -211,7 +215,12 @@ impl MpoolCommands { to, from, } => { - let messages = api.mpool_pending(vec![]).await?; + let messages = MpoolPending::call( + &rpc::Client::from(api.clone()), + (LotusJson(ApiTipsetKey(None)),), + ) + .await? + .into_inner(); let local_addrs = if local { let response = api.wallet_list().await?; @@ -245,7 +254,12 @@ impl MpoolCommands { let atto_str = api.chain_get_min_base_fee(basefee_lookback).await?; let min_base_fee = TokenAmount::from_atto(atto_str.parse::()?); - let messages = api.mpool_pending(vec![]).await?; + let messages = MpoolPending::call( + &rpc::Client::from(api.clone()), + (LotusJson(ApiTipsetKey(None)),), + ) + .await? + .into_inner(); let local_addrs = if local { let response = api.wallet_list().await?; diff --git a/src/rpc_client/mod.rs b/src/rpc_client/mod.rs index fbb9a4af48cd..349cbb63f510 100644 --- a/src/rpc_client/mod.rs +++ b/src/rpc_client/mod.rs @@ -6,7 +6,6 @@ pub mod beacon_ops; pub mod chain_ops; pub mod common_ops; pub mod eth_ops; -pub mod mpool_ops; pub mod net_ops; pub mod node_ops; pub mod state_ops; diff --git a/src/rpc_client/mpool_ops.rs b/src/rpc_client/mpool_ops.rs deleted file mode 100644 index c0e3e8ab44a6..000000000000 --- a/src/rpc_client/mpool_ops.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2019-2024 ChainSafe Systems -// SPDX-License-Identifier: Apache-2.0, MIT - -use crate::{ - message::SignedMessage, - rpc::{mpool_api::*, RpcMethod}, -}; -use cid::Cid; - -use super::{ApiInfo, JsonRpcError, RpcRequest}; - -impl ApiInfo { - pub async fn mpool_pending(&self, cids: Vec) -> Result, JsonRpcError> { - self.call(Self::mpool_pending_req(cids)).await - } - - pub fn mpool_pending_req(cids: Vec) -> RpcRequest> { - RpcRequest::new(MpoolPending::NAME, (cids,)) - } -}