-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(audit): shorten CLI's function bodies #215
base: main
Are you sure you want to change the base?
Conversation
This commit addresses finding B1 from the Trail of Bits audit titled 'Functions with too many lines.'
8c7e4dc
to
0142629
Compare
0142629
to
446cef7
Compare
4000691
to
62b6651
Compare
@robin-near, could you review it again, please? BTW, CI checks seem to be flaky – I had to manually re-run the tests to get them to pass. |
node/src/mpc_client.rs
Outdated
mpc_client: MpcClient, | ||
auto_abort: tracking::AutoAbortTask<T>, | ||
) -> anyhow::Result<(), JoinError> { | ||
let _auto_abort_metrics = auto_abort; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait I'm not sure why _auto_abort_metrics needs to be in here - we can just have the run() function keep that as a local variable. Don't need to move it in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it here:
Lines 61 to 75 in 972150d
pub async fn run( | |
self, | |
channel_receiver: mpsc::Receiver<NetworkTaskChannel>, | |
mut sign_request_receiver: tokio::sync::OwnedMutexGuard< | |
mpsc::UnboundedReceiver<ChainSignatureRequest>, | |
>, | |
chain_txn_sender: mpsc::Sender<ChainSendTransactionRequest>, | |
) -> anyhow::Result<()> { | |
let client = self.client.clone(); | |
let metrics_emitter = tracking::spawn("periodically emits metrics", async move { | |
loop { | |
client.emit_metrics(); | |
tokio::time::sleep(std::time::Duration::from_secs(5)).await; | |
} | |
}); |
Lemme know if this is what you meant.
9a912ee
to
972150d
Compare
This commit addresses finding B1 from the Trail of Bits audit titled 'Functions with too many lines.'