Skip to content

Commit 09d6988

Browse files
committed
qq
1 parent 24292a5 commit 09d6988

20 files changed

Lines changed: 45 additions & 32 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,6 @@ overflow-checks = true
335335
[profile.test.package.script]
336336
opt-level = 2
337337

338-
[features]
339-
tokio-console = []
340-
trezor = []
341-
ledger = []
342-
default = ["trezor", "ledger"]
343-
344338
[patch.crates-io]
345339
# Using fontconfig-parser v0.5.8 completely breaks UI in node-gui on Linux - most of the text disappears and the few
346340
# characters that remain have broken spacing, so we force the usage of v0.5.7 via "patch".

node-gui/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ ledger = [
5151
"wallet-cli-commands/ledger",
5252
"node-gui-backend/ledger",
5353
]
54-
default = ["trezor", "ledger"]
54+
default = ["trezor"]

node-gui/backend/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ ledger = [
5858
"wallet-rpc-client/ledger",
5959
"wallet-cli-commands/ledger",
6060
]
61-
default = ["trezor", "ledger"]
61+
default = ["trezor"]

node-gui/src/main_window/main_widget/tabs/wallet/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ impl Tab for WalletTab {
472472
let text = match node_state.wallets.get(&self.wallet_id) {
473473
Some(wallet_info) => match wallet_info.extra_info {
474474
wallet_controller::types::WalletExtraInfo::SoftwareWallet => "Software wallet",
475+
#[cfg(feature = "trezor")]
475476
wallet_controller::types::WalletExtraInfo::TrezorWallet { .. } => "Trezor wallet",
477+
#[cfg(feature = "ledger")]
476478
wallet_controller::types::WalletExtraInfo::LedgerWallet { .. } => "Ledger wallet",
477479
},
478480
None => "No wallet",

node-gui/src/main_window/main_widget/tabs/wallet/status_bar.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
// limitations under the License.
1515

1616
#[cfg(any(feature = "trezor", feature = "ledger"))]
17-
use iced::widget::{rich_text, span};
17+
use iced::widget::{rich_text, row, span};
1818
use iced::{
1919
font,
20-
widget::{container, row, Container},
20+
widget::{container, Container, Row},
2121
Alignment, Element, Font, Length, Padding, Theme,
2222
};
2323

@@ -31,13 +31,17 @@ const HORIZONTAL_PADDING: f32 = 10.;
3131

3232
#[allow(clippy::float_arithmetic)]
3333
pub fn estimate_status_bar_height(wallet_info: &WalletExtraInfo) -> f32 {
34+
#[cfg(any(feature = "trezor", feature = "ledger"))]
35+
let height_for_hw_wallet = TEXT_SIZE + 2. * VERTICAL_PADDING
36+
// For some reason, the status bar gets a bit of additional height.
37+
+ 4.;
38+
3439
match wallet_info {
3540
WalletExtraInfo::SoftwareWallet => 0.,
36-
WalletExtraInfo::TrezorWallet { .. } | WalletExtraInfo::LedgerWallet { .. } => {
37-
TEXT_SIZE + 2. * VERTICAL_PADDING
38-
// For some reason, the status bar gets a bit of additional height.
39-
+ 4.
40-
}
41+
#[cfg(feature = "trezor")]
42+
WalletExtraInfo::TrezorWallet { .. } => height_for_hw_wallet,
43+
#[cfg(feature = "ledger")]
44+
WalletExtraInfo::LedgerWallet { .. } => height_for_hw_wallet,
4145
}
4246
}
4347

@@ -47,7 +51,7 @@ pub fn view_status_bar(wallet_info: &WalletExtraInfo) -> Option<Element<'static,
4751
..Font::default()
4852
};
4953

50-
let row = match wallet_info {
54+
let row: Row<'_, WalletMessage> = match wallet_info {
5155
WalletExtraInfo::SoftwareWallet => {
5256
return None;
5357
}

utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tempfile.workspace = true
4040
loom.workspace = true
4141

4242
[features]
43-
tokio-console = []
43+
tokio-console = ["logging/tokio-console"]
4444

4545
[[bench]]
4646
name = "benches"

wallet/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ ledger = [
8787
"dep:mintlayer-ledger-messages",
8888
"wallet-types/ledger",
8989
]
90-
default = ["trezor", "ledger"]
90+
default = ["trezor"]

wallet/storage/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ rstest.workspace = true
2727
[features]
2828
trezor = ["wallet-types/trezor"]
2929
ledger = ["wallet-types/ledger"]
30-
default = ["trezor", "ledger"]
30+
default = ["trezor"]

wallet/types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ rstest.workspace = true
3838
[features]
3939
trezor = []
4040
ledger = []
41-
default = ["trezor", "ledger"]
41+
default = ["trezor"]

wallet/types/src/hw_data.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
use core::fmt;
17-
1816
use serialization::{Decode, Encode};
1917

2018
/// This is the data that will be stored in the wallet db.
@@ -56,8 +54,9 @@ pub enum LedgerModel {
5654
Unknown { usb_pid: Option<u16> },
5755
}
5856

59-
impl fmt::Display for LedgerModel {
60-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
57+
#[cfg(feature = "ledger")]
58+
impl std::fmt::Display for LedgerModel {
59+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6160
match self {
6261
LedgerModel::NanoS => write!(f, "Nano S"),
6362
LedgerModel::NanoSPlus => write!(f, "Nano S Plus"),

0 commit comments

Comments
 (0)