Skip to content

Commit bceaf71

Browse files
committed
Merge branch 'gamma-dev' of github.com:aspectron/kaspa-ng into gamma-dev
2 parents acd2f4d + b757180 commit bceaf71

File tree

11 files changed

+1412
-995
lines changed

11 files changed

+1412
-995
lines changed

Cargo.lock

+98-98
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/resources/i18n/i18n.json

+1,266-864
Large diffs are not rendered by default.

core/src/core.rs

+14-5
Original file line numberDiff line numberDiff line change
@@ -812,16 +812,16 @@ impl Core {
812812
match metrics {
813813
MetricsUpdate::WalletMetrics {
814814
mempool_size,
815-
node_peers: peers,
816-
network_tps: tps,
815+
// node_peers: peers,
816+
// network_tps: tps,
817817
} => {
818818
self.sender().try_send(Events::MempoolSize {
819819
mempool_size: mempool_size as usize,
820820
})?;
821821

822-
self.state.node_peers = Some(peers as usize);
822+
// self.state.node_peers = None;
823823
self.state.node_mempool_size = Some(mempool_size as usize);
824-
self.state.network_tps = Some(tps);
824+
// self.state.network_tps = None;
825825
}
826826
}
827827
}
@@ -1115,7 +1115,7 @@ impl Core {
11151115
if let Some(account) = account_collection.get(&id.into()) {
11161116
account.update_balance(balance)?;
11171117
} else {
1118-
log_error!("unable to find account {}", id);
1118+
log_error!("unable to find account {} while updating balance.", id);
11191119
}
11201120
} else {
11211121
log_error!(
@@ -1298,6 +1298,15 @@ impl Core {
12981298
});
12991299

13001300
if let Some(first) = accounts.first() {
1301+
self.load_account_transactions_with_range(first, 0..TRANSACTION_PAGE_SIZE)
1302+
.map_err(|err| {
1303+
log_error!(
1304+
"error loading transactions for account {}: {}",
1305+
first.id(),
1306+
err
1307+
);
1308+
})
1309+
.ok();
13011310
let device = self.device().clone();
13021311
let wallet = self.wallet();
13031312
self.get_mut::<modules::AccountManager>().select(

core/src/modules/account_manager/balance.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,21 @@ impl<'context> BalancePane<'context> {
5353
}
5454

5555
if balance.pending != 0 {
56-
ui.label(format!(
57-
"Pending: {}",
58-
sompi_to_kaspa_string_with_suffix(
56+
ui.label(i18n_args(
57+
"Pending: {amount}",
58+
&[("amount", &sompi_to_kaspa_string_with_suffix(
5959
balance.pending,
6060
network_type
61-
)
61+
))]
6262
));
6363
}
6464
if balance.outgoing != 0 {
65-
ui.label(format!(
66-
"Sending: {}",
67-
sompi_to_kaspa_string_with_suffix(
65+
ui.label(i18n_args(
66+
"Sending: {amount}",
67+
&[("amount", &sompi_to_kaspa_string_with_suffix(
6868
balance.outgoing,
6969
network_type
70-
)
70+
))]
7171
));
7272
}
7373

core/src/modules/account_manager/menus.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl WalletMenu {
2323
let wallet_name = if let Some(wallet_descriptor) = core.wallet_descriptor.as_ref() {
2424
wallet_descriptor.title.as_deref().unwrap_or(wallet_descriptor.filename.as_str()).to_string()
2525
} else {
26-
ui.label("Missing wallet descriptor");
26+
ui.label(i18n("Missing wallet descriptor"));
2727
return;
2828
};
2929

@@ -41,7 +41,7 @@ impl WalletMenu {
4141
let wallet_filename = if let Some(wallet_descriptor) = core.wallet_descriptor.as_ref() {
4242
wallet_descriptor.filename.clone()
4343
} else {
44-
ui.label("Missing wallet descriptor");
44+
ui.label(i18n("Missing wallet descriptor"));
4545
return;
4646
};
4747

@@ -241,7 +241,7 @@ impl ToolsMenu {
241241
}
242242
pub fn render(&mut self, core: &mut Core, ui : &mut Ui, _account_manager : &mut AccountManager, _rc : &RenderContext, max_height: f32) {
243243

244-
PopupPanel::new(PopupPanel::id(ui,"tools_popup"),|ui|{ ui.add(Label::new(i18n("Tools ⏷")).sense(Sense::click())) }, |ui, _| {
244+
PopupPanel::new(PopupPanel::id(ui,"tools_popup"),|ui|{ ui.add(Label::new(format!("{} ⏷", i18n("Tools"))).sense(Sense::click())) }, |ui, _| {
245245

246246
egui::ScrollArea::vertical()
247247
.id_source("tools_popup_scroll")

core/src/modules/account_manager/overview.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'manager> Overview<'manager> {
4545
ui.vertical_centered(|ui|{
4646

4747
ui.add_space(16.);
48-
ui.label(RichText::new("An error has occurred while submitting transaction:"));
48+
ui.label(RichText::new(i18n("An error has occurred while submitting transaction:")));
4949
ui.add_space(16.);
5050
ui.separator();
5151
ui.add_space(8.);

core/src/modules/block_dag.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl ModuleT for BlockDag {
171171
ui.heading(i18n("Block DAG"));
172172

173173
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
174-
PopupPanel::new(PopupPanel::id(ui,"block_dag_settings"),|ui|{ ui.add(Label::new("Settings ⏷").sense(Sense::click())) }, |ui, _| {
174+
PopupPanel::new(PopupPanel::id(ui,"block_dag_settings"),|ui|{ ui.add(Label::new(format!("{} ⏷", i18n("Settings"))).sense(Sense::click())) }, |ui, _| {
175175

176176
CollapsingHeader::new(i18n("Dimensions"))
177177
.open(Some(true))

core/src/modules/scanner.rs

+13-8
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl ModuleT for Scanner {
102102
let back = Rc::new(RefCell::new(false));
103103

104104
Panel::new(self)
105-
.with_caption("Scanner")
105+
.with_caption(i18n("Scanner"))
106106
.with_back(|_this| {
107107
*back.borrow_mut() = true;
108108
})
@@ -295,7 +295,7 @@ impl ModuleT for Scanner {
295295
).await?;
296296

297297
} else {
298-
*status.lock().unwrap() = Status::error("Account not found");
298+
*status.lock().unwrap() = Status::error(i18n("Account not found"));
299299
}
300300

301301
Ok(())
@@ -328,10 +328,13 @@ impl ModuleT for Scanner {
328328
ui.label(message);
329329
}
330330
Status::Processing { index, utxo_count, balance } => {
331-
ui.label(format!("Scanning address derivation {}...", index.separated_string()));
332-
ui.label(format!("Located {} UTXOs", utxo_count.separated_string()));
331+
//ui.label(format!("Scanning address derivation {}...", index.separated_string()));
332+
//ui.label(format!("Located {} UTXOs", utxo_count.separated_string()));
333+
ui.label(i18n_args("Scanning address derivation {index}...", &[("index", &index.separated_string())]));
334+
ui.label(i18n_args("Located {utxo_count} UTXOs", &[("utxo_count", &utxo_count.separated_string())]));
335+
333336
ui.add_space(16.);
334-
ui.label(RichText::new("BALANCE").size(12.).raised());
337+
ui.label(RichText::new(i18n("BALANCE")).size(12.).raised());
335338
ui.label(
336339
s2kws_layout_job(core.balance_padding(), *balance, &network_type, theme_color().balance_color,FontId::proportional(28.))
337340
);
@@ -368,10 +371,12 @@ impl ModuleT for Scanner {
368371
.with_body(|this,ui| {
369372

370373
if let Status::Processing { index,utxo_count, balance } = &*this.context.status.lock().unwrap() {
371-
ui.label(format!("Total addresses scanned: {}", index.separated_string()));
372-
ui.label(format!("Located {} UTXOs", utxo_count.separated_string()));
374+
//ui.label(format!("Total addresses scanned: {}", index.separated_string()));
375+
//ui.label(format!("Located {} UTXOs", utxo_count.separated_string()));
376+
ui.label(i18n_args("Total addresses scanned: {index}", &[("index", &index.separated_string())]));
377+
ui.label(i18n_args("Located {utxo_count} UTXOs", &[("utxo_count", &utxo_count.separated_string())]));
373378
ui.add_space(16.);
374-
ui.label(RichText::new("BALANCE").size(12.).raised());
379+
ui.label(RichText::new(i18n("BALANCE")).size(12.).raised());
375380
ui.label(
376381
s2kws_layout_job(balance_padding, *balance, &network_type, theme_color().balance_color,FontId::proportional(28.))
377382
);

core/src/modules/wallet_create.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ impl ModuleT for WalletCreate {
519519

520520
})
521521
.with_footer(|this,ui| {
522-
let text = if this.context.account_name.is_not_empty() { i18n("Continue") } else { "Skip" };
522+
let text = if this.context.account_name.is_not_empty() { i18n("Continue") } else { i18n("Skip") };
523523
if ui.large_button(i18n(text)).clicked() {
524524
this.state = State::PhishingHint;
525525
this.focus.next(Focus::PhishingHint);
@@ -1167,7 +1167,7 @@ impl ModuleT for WalletCreate {
11671167
prv_key_data_id,
11681168
args.account_name.is_not_empty().then_some(args.account_name.clone()),
11691169
);
1170-
account_descriptors.push(wallet.clone().accounts_create(wallet_secret.clone(), account_create_args).await?);
1170+
account_descriptors.push(wallet.clone().accounts_import(wallet_secret.clone(), account_create_args).await?);
11711171
}
11721172
}else{
11731173
for account_index in 0..number_of_accounts {
@@ -1177,7 +1177,7 @@ impl ModuleT for WalletCreate {
11771177
args.account_name.is_not_empty().then_some(args.account_name.clone()),
11781178
Some(account_index as u64),
11791179
);
1180-
account_descriptors.push(wallet.clone().accounts_create(wallet_secret.clone(), account_create_args).await?);
1180+
account_descriptors.push(wallet.clone().accounts_import(wallet_secret.clone(), account_create_args).await?);
11811181
}
11821182
}
11831183

core/src/modules/wallet_secret.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl ModuleT for WalletSecret {
131131
// let mut back = false;
132132

133133
Panel::new(self)
134-
.with_caption("Change Wallet Secret")
134+
.with_caption(i18n("Change Wallet Secret"))
135135
.with_back(|_this| {
136136
*back.borrow_mut() = true;
137137
})

core/src/modules/welcome.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ impl Welcome {
158158
if ui.medium_button(format!("{} {}", egui_phosphor::light::CHECK, i18n("Apply"))).clicked() {
159159
let mut settings = self.settings.clone();
160160
settings.initialized = true;
161-
settings.store_sync().expect("Unable to store settings");
161+
let message = i18n("Unable to store settings");
162+
settings.store_sync().expect(message);
162163
self.runtime.kaspa_service().update_services(&self.settings.node, None);
163164
core.settings = settings.clone();
164165
core.get_mut::<modules::Settings>().load(settings);
@@ -231,8 +232,8 @@ impl Welcome {
231232
if proceed {
232233
let mut settings = self.settings.clone();
233234
settings.initialized = true;
234-
235-
settings.store_sync().expect("Unable to store settings");
235+
let message = i18n("Unable to store settings");
236+
settings.store_sync().expect(message);
236237
core.settings = settings.clone();
237238
self.runtime.kaspa_service().update_services(&settings.node, None);
238239

0 commit comments

Comments
 (0)