Skip to content

Commit

Permalink
refactor: got rid of redundant pub(self)
Browse files Browse the repository at this point in the history
  • Loading branch information
rozhkovdmitrii committed Jun 21, 2023
1 parent ff5ebf7 commit 53b36ed
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions mm2src/adex_cli/src/adex_proc/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ where
T: Serialize + Sized,
{
#[serde(flatten, skip_serializing_if = "Option::is_none")]
pub(self) flatten_data: Option<T>,
pub(self) userpass: String,
flatten_data: Option<T>,
userpass: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub(self) method: Option<Method>,
method: Option<Method>,
}

#[derive(Serialize, Clone, Display)]
Expand Down
26 changes: 13 additions & 13 deletions mm2src/adex_cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,53 +212,53 @@ impl From<&OrderbookCliArgs> for OrderbookConfig {
#[derive(Args, Serialize, Debug)]
struct OrderCli {
#[arg(help = "Base currency of a pair")]
pub(self) base: String,
base: String,
#[arg(help = "Related currency")]
pub(self) rel: String,
rel: String,
#[arg(help = "Amount of coins the user is willing to sell/buy of the base coin", value_parser=parse_mm_number )]
pub(self) volume: MmNumber,
volume: MmNumber,
#[arg(help = "Price in rel the user is willing to receive/pay per one unit of the base coin", value_parser=parse_mm_number)]
pub(self) price: MmNumber,
price: MmNumber,
#[arg(long, value_enum, default_value_t = OrderTypeCli::GoodTillCancelled, help="The GoodTillCancelled order is automatically converted to a maker order if not matched in 30 seconds, and this maker order stays in the orderbook until explicitly cancelled. On the other hand, a FillOrKill is cancelled if not matched within 30 seconds")]
pub(self) order_type: OrderTypeCli,
order_type: OrderTypeCli,
#[arg(long,
help = "Amount of base coin that will be used as min_volume of GoodTillCancelled order after conversion to maker",
value_parser=parse_mm_number
)]
pub(self) min_volume: Option<MmNumber>,
min_volume: Option<MmNumber>,
#[arg(short='u', long="uuid", action = ArgAction::Append, help="The created order is matched using a set of uuid")]
pub(self) match_uuids: Vec<Uuid>,
match_uuids: Vec<Uuid>,
#[arg(short='p',
long="public",
value_parser=H256Json::from_str,
action = ArgAction::Append,
help="The created order is matched using a set of publics to select specific nodes (ignored if uuids not empty)")]
pub(self) match_publics: Vec<H256Json>,
match_publics: Vec<H256Json>,
#[arg(
long,
help = "Number of required blockchain confirmations for base coin atomic swap transaction"
)]
pub(self) base_confs: Option<u64>,
base_confs: Option<u64>,
#[arg(
long,
help = "Whether dPoW notarization is required for base coin atomic swap transaction"
)]
pub(self) base_nota: Option<bool>,
base_nota: Option<bool>,
#[arg(
long,
help = "Number of required blockchain confirmations for rel coin atomic swap transaction"
)]
pub(self) rel_confs: Option<u64>,
rel_confs: Option<u64>,
#[arg(
long,
help = "Whether dPoW notarization is required for rel coin atomic swap transaction"
)]
pub(self) rel_nota: Option<bool>,
rel_nota: Option<bool>,
#[arg(
long,
help = "If true, each order's short record history is stored else the only order status will be temporarily stored while in progress"
)]
pub(self) save_in_history: bool,
save_in_history: bool,
}

fn parse_mm_number(value: &str) -> Result<MmNumber, ParseBigDecimalError> {
Expand Down
2 changes: 1 addition & 1 deletion mm2src/adex_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#[cfg(not(target_arch = "wasm32"))] mod adex_proc;
#[cfg(not(target_arch = "wasm32"))] mod cli;
#[cfg(not(target_arch = "wasm32"))] mod helpers;
pub(self) mod logging;
mod logging;
#[cfg(not(target_arch = "wasm32"))] mod scenarios;
#[cfg(all(not(target_arch = "wasm32"), test))] mod tests;
#[cfg(not(target_arch = "wasm32"))] mod transport;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_ordermatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5471,7 +5471,7 @@ pub async fn cancel_all_orders_rpc(ctx: MmArc, req: Json) -> Result<Response<Vec
/// # Safety
///
/// The function locks [`MmCtx::p2p_ctx`] and [`MmCtx::ordermatch_ctx`]
pub(self) async fn subscribe_to_orderbook_topic(
async fn subscribe_to_orderbook_topic(
ctx: &MmArc,
base: &str,
rel: &str,
Expand Down

0 comments on commit 53b36ed

Please sign in to comment.