Skip to content

Commit

Permalink
Merge pull request #1103 from rainlanguage/remove-unused-tauri
Browse files Browse the repository at this point in the history
Remove usused tauri commands
  • Loading branch information
hardingjam authored Dec 31, 2024
2 parents d566b4b + a7ef215 commit a078a2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 80 deletions.
17 changes: 1 addition & 16 deletions tauri-app/src-tauri/src/commands/order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rain_orderbook_app_settings::{deployment::Deployment, scenario::Scenario};
use rain_orderbook_common::{
add_order::AddOrderArgs, csv::TryIntoCsv, dotrain_order::DotrainOrder,
remove_order::RemoveOrderArgs, subgraph::SubgraphArgs, transaction::TransactionArgs,
types::FlattenError, types::OrderDetailExtended, types::OrderFlattened,
types::FlattenError, types::OrderFlattened,
};
use std::fs;
use std::path::PathBuf;
Expand All @@ -31,21 +31,6 @@ pub async fn orders_list_write_csv(
Ok(())
}

#[tauri::command]
pub async fn order_detail(
id: String,
subgraph_args: SubgraphArgs,
) -> CommandResult<OrderDetailExtended> {
let order = subgraph_args
.to_subgraph_client()
.await?
.order_detail(id.into())
.await?;
let order_extended: OrderDetailExtended = order.try_into()?;

Ok(order_extended)
}

#[tauri::command]
pub async fn order_add(
app_handle: AppHandle,
Expand Down
53 changes: 0 additions & 53 deletions tauri-app/src-tauri/src/commands/order_take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,9 @@ use crate::error::CommandResult;
use rain_orderbook_common::{
csv::TryIntoCsv, subgraph::SubgraphArgs, types::FlattenError, types::OrderTakeFlattened,
};

use rain_orderbook_subgraph_client::performance::vol::VaultVolume;
use rain_orderbook_subgraph_client::{types::common::*, PaginationArgs};
use std::fs;
use std::path::PathBuf;

#[tauri::command]
pub async fn order_trades_list(
order_id: String,
subgraph_args: SubgraphArgs,
pagination_args: PaginationArgs,
start_timestamp: Option<u64>,
end_timestamp: Option<u64>,
) -> CommandResult<Vec<Trade>> {
let order_takes = subgraph_args
.to_subgraph_client()
.await?
.order_trades_list(
order_id.clone().into(),
pagination_args,
start_timestamp,
end_timestamp,
)
.await?;
Ok(order_takes)
}

#[tauri::command]
pub async fn order_trades_list_write_csv(
path: PathBuf,
Expand All @@ -51,32 +27,3 @@ pub async fn order_trades_list_write_csv(

Ok(())
}

#[tauri::command]
pub async fn order_vaults_volume(
order_id: String,
subgraph_args: SubgraphArgs,
start_timestamp: Option<u64>,
end_timestamp: Option<u64>,
) -> CommandResult<Vec<VaultVolume>> {
Ok(subgraph_args
.to_subgraph_client()
.await?
.order_vaults_volume(order_id.clone().into(), start_timestamp, end_timestamp)
.await?)
}

#[tauri::command]
pub async fn order_trades_count(
order_id: String,
subgraph_args: SubgraphArgs,
start_timestamp: Option<u64>,
end_timestamp: Option<u64>,
) -> CommandResult<usize> {
Ok(subgraph_args
.to_subgraph_client()
.await?
.order_trades_list_all(order_id.clone().into(), start_timestamp, end_timestamp)
.await?
.len())
}
15 changes: 4 additions & 11 deletions tauri-app/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ use commands::config::{convert_configstring_to_config, merge_configstrings, pars
use commands::dotrain::parse_dotrain;
use commands::dotrain_add_order_lsp::{call_lsp_completion, call_lsp_hover, call_lsp_problems};
use commands::order::{
compose_from_scenario, order_add, order_add_calldata, order_detail, order_remove,
order_remove_calldata, orders_list_write_csv, validate_raindex_version,
compose_from_scenario, order_add, order_add_calldata, order_remove, order_remove_calldata,
orders_list_write_csv, validate_raindex_version,
};
use commands::order_quote::{batch_order_quotes, debug_order_quote};
use commands::order_take::{
order_trades_count, order_trades_list, order_trades_list_write_csv,
order_vaults_volume,
};
use commands::order_take::order_trades_list_write_csv;
use commands::trade_debug::debug_trade;
use commands::vault::{
vault_balance_changes_list, vault_balance_changes_list_write_csv, vault_deposit,
Expand Down Expand Up @@ -53,10 +50,8 @@ fn run_tauri_app() {
vault_deposit,
vault_withdraw,
orders_list_write_csv,
order_detail,
order_add,
order_remove,
order_trades_list,
order_trades_list_write_csv,
get_address_from_ledger,
get_chainid,
Expand All @@ -80,9 +75,7 @@ fn run_tauri_app() {
debug_order_quote,
debug_trade,
get_app_commit_sha,
validate_raindex_version,
order_vaults_volume,
order_trades_count,
validate_raindex_version
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
Expand Down

0 comments on commit a078a2c

Please sign in to comment.