cargo fmt
This commit is contained in:
parent
713bfdb6ff
commit
bd35323627
|
@ -36,9 +36,9 @@ pub async fn acc_retrieve_portfolio(
|
|||
) -> io::Result<Portfolio> {
|
||||
if auth_jwt.is_empty() == true {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::PermissionDenied,
|
||||
"ACC_RETRIEVE_PORTFOLIO: JWT TOKEN EMPTY"
|
||||
));
|
||||
io::ErrorKind::PermissionDenied,
|
||||
"ACC_RETRIEVE_PORTFOLIO: JWT TOKEN EMPTY",
|
||||
));
|
||||
}
|
||||
|
||||
/* build message request */
|
||||
|
|
|
@ -37,9 +37,9 @@ pub async fn acc_retrieve_transaction(
|
|||
) -> io::Result<Vec<Transaction>> {
|
||||
if auth_jwt.is_empty() == true {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::PermissionDenied,
|
||||
"ACC_RETRIEVE_TRANSACTION: JWT TOKEN EMPTY"
|
||||
));
|
||||
io::ErrorKind::PermissionDenied,
|
||||
"ACC_RETRIEVE_TRANSACTION: JWT TOKEN EMPTY",
|
||||
));
|
||||
}
|
||||
|
||||
/* build message request */
|
||||
|
|
|
@ -57,16 +57,23 @@ pub async fn get_server_salt(
|
|||
)
|
||||
})?;
|
||||
|
||||
if assert_msg(&ret_msg, MessageType::DataTransfer,
|
||||
true, 1,
|
||||
false, 0,
|
||||
true, 1,
|
||||
true, digest::SHA512_OUTPUT_LEN / 2) {
|
||||
if assert_msg(
|
||||
&ret_msg,
|
||||
MessageType::DataTransfer,
|
||||
true,
|
||||
1,
|
||||
false,
|
||||
0,
|
||||
true,
|
||||
1,
|
||||
true,
|
||||
digest::SHA512_OUTPUT_LEN / 2,
|
||||
) {
|
||||
Ok(*array_ref!(ret_msg.data, 0, digest::SHA512_OUTPUT_LEN / 2))
|
||||
}
|
||||
else {
|
||||
Err(io::Error::new(io::ErrorKind::InvalidData,
|
||||
format!("{}", ReturnFlags::ClientReqSaltInvMsg),
|
||||
))
|
||||
} else {
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::InvalidData,
|
||||
format!("{}", ReturnFlags::ClientReqSaltInvMsg),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::io;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use std::net::ToSocketAddrs;
|
||||
|
||||
use log::warn;
|
||||
use argh::FromArgs;
|
||||
use log::warn;
|
||||
|
||||
use tokio::io::AsyncReadExt;
|
||||
use tokio::net::TcpListener;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use std::io;
|
||||
use log::warn;
|
||||
use std::io;
|
||||
|
||||
use crate::common::message::inst::DataTransferInst;
|
||||
use crate::common::message::message::Message;
|
||||
|
@ -42,8 +42,9 @@ pub async fn retrieve_portfolio(
|
|||
Err(err) => {
|
||||
warn!("RETRIEVE_PORTFOLIO_FAILED: {}", err);
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("{}: {}", ReturnFlags::ServerRetrievePortfolioFailed, err)))
|
||||
io::ErrorKind::Other,
|
||||
format!("{}: {}", ReturnFlags::ServerRetrievePortfolioFailed, err),
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use std::io;
|
||||
use log::warn;
|
||||
use std::io;
|
||||
|
||||
use crate::common::message::inst::DataTransferInst;
|
||||
use crate::common::message::message::Message;
|
||||
|
@ -43,8 +43,9 @@ pub async fn retrieve_transactions(
|
|||
Err(err) => {
|
||||
warn!("RETRIEVE_TRANSACTION_FAILED: {}", err);
|
||||
Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("{}: {}", ReturnFlags::ServerRetrieveTransactionFailed, err)))
|
||||
io::ErrorKind::Other,
|
||||
format!("{}: {}", ReturnFlags::ServerRetrieveTransactionFailed, err),
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue