Skip to content

Commit

Permalink
Run cargo fmt on the firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
afilini committed May 24, 2024
1 parent eca386f commit 1a8feb8
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 72 deletions.
10 changes: 5 additions & 5 deletions firmware/build.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand All @@ -21,4 +21,4 @@ fn main() {
} else if cfg!(feature = "device") {
println!("cargo:rustc-link-arg=-L./linker-scripts/device");
}
}
}
8 changes: 4 additions & 4 deletions firmware/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
8 changes: 4 additions & 4 deletions firmware/src/emulator/config.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
8 changes: 4 additions & 4 deletions firmware/src/emulator/hw.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
8 changes: 4 additions & 4 deletions firmware/src/emulator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
8 changes: 4 additions & 4 deletions firmware/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
25 changes: 17 additions & 8 deletions firmware/src/handlers/bitcoin.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand All @@ -33,8 +33,8 @@ use bdk::miniscript::{DescriptorPublicKey, ForEachKey};
use bdk::HdKeyPaths;

use gui::{
ShowScrollingAddressPage, GenericTwoLinePage, LoadingPage, Page, SigningTxPage,
SummaryPage, TxOutputPage, TxSummaryPage,
GenericTwoLinePage, LoadingPage, Page, ShowScrollingAddressPage, SigningTxPage, SummaryPage,
TxOutputPage, TxSummaryPage,
};
use model::{
DescriptorVariant, ExtendedKey, MultisigKey, ScriptType, SerializedDerivationPath,
Expand Down Expand Up @@ -561,7 +561,12 @@ pub async fn handle_set_descriptor_request(

let mut page = GenericTwoLinePage::new(
"Address type",
new_wallet.config.secret.descriptor.script_type.display_name(),
new_wallet
.config
.secret
.descriptor
.script_type
.display_name(),
"HOLD BTN FOR NEXT PAGE",
50,
);
Expand Down Expand Up @@ -641,7 +646,11 @@ pub async fn handle_set_descriptor_request(

log::debug!("First address: {}", first_address);
let address_str = first_address.to_string();
let mut page = ShowScrollingAddressPage::new(&address_str, "Confirm first address", "HOLD BTN FOR NEXT PAGE");
let mut page = ShowScrollingAddressPage::new(
&address_str,
"Confirm first address",
"HOLD BTN FOR NEXT PAGE",
);
page.init_display(&mut peripherals.display)?;
page.draw_to(&mut peripherals.display)?;
peripherals.display.flush()?;
Expand Down
8 changes: 4 additions & 4 deletions firmware/src/handlers/fwupdate.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
10 changes: 5 additions & 5 deletions firmware/src/handlers/idle.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down Expand Up @@ -47,7 +47,7 @@ pub async fn handle_idle(
.nfc
.send(Reply::Info(DeviceInfo::new_unlocked_initialized(
wallet.network(),
env!("CARGO_PKG_VERSION")
env!("CARGO_PKG_VERSION"),
)))
.await
.unwrap();
Expand Down
20 changes: 10 additions & 10 deletions firmware/src/handlers/init.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand All @@ -36,9 +36,7 @@ use bdk::keys::{
DescriptorKey, DescriptorPublicKey, DescriptorSecretKey, ScriptContext, ValidNetworks,
};

use gui::{
GeneratingMnemonicPage, LoadingPage, MnemonicPage, Page, WelcomePage,
};
use gui::{GeneratingMnemonicPage, LoadingPage, MnemonicPage, Page, WelcomePage};
use model::{Config, DeviceInfo};

use super::*;
Expand Down Expand Up @@ -308,7 +306,9 @@ pub async fn handle_init(
Some(model::Request::GetInfo) => {
peripherals
.nfc
.send(model::Reply::Info(DeviceInfo::new_locked_uninitialized(env!("CARGO_PKG_VERSION"))))
.send(model::Reply::Info(DeviceInfo::new_locked_uninitialized(
env!("CARGO_PKG_VERSION"),
)))
.await
.unwrap();
peripherals.nfc_finished.recv().await.unwrap();
Expand Down Expand Up @@ -374,7 +374,7 @@ pub async fn handle_locked(
.nfc
.send(model::Reply::Info(DeviceInfo::new_locked_initialized(
config.network,
env!("CARGO_PKG_VERSION")
env!("CARGO_PKG_VERSION"),
)))
.await
.unwrap();
Expand Down Expand Up @@ -569,7 +569,7 @@ pub async fn handle_unverified_config(
.send(model::Reply::Info(DeviceInfo::new_unverified_config(
config.network,
config.pair_code.is_some(),
env!("CARGO_PKG_VERSION")
env!("CARGO_PKG_VERSION"),
)))
.await
.unwrap();
Expand Down
8 changes: 4 additions & 4 deletions firmware/src/handlers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
8 changes: 4 additions & 4 deletions firmware/src/hw/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
8 changes: 4 additions & 4 deletions firmware/src/hw/tsc.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Portal Hardware Wallet firmware and supporting software libraries
//
//
// Copyright (C) 2024 Alekos Filini
//
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

Expand Down
Loading

0 comments on commit 1a8feb8

Please sign in to comment.