Skip to content

Commit 785d9f6

Browse files
authored
Merge pull request #8 from LayerTwo-Labs/2026-05-16-backport-thunder-0.16.0
Backport Thunder 0.16.0
2 parents 03932c1 + 7e70e16 commit 785d9f6

24 files changed

Lines changed: 1812 additions & 571 deletions

Cargo.lock

Lines changed: 904 additions & 409 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ clap = "4.5.4"
2525
dirs = "5.0.1"
2626
dotenvy = "0.15.7"
2727
educe = { version = "0.6.0", default-features = false }
28-
eframe = "0.31.0"
28+
eframe = "0.34.0"
2929
error-fatality = "0.1.2"
3030
fallible-iterator = "0.3.0"
3131
fips205 = "0.4.1"
@@ -88,12 +88,12 @@ uuid = "1.13.1"
8888
[workspace.dependencies.bip300301_enforcer_lib]
8989
default-features = false
9090
git = "https://github.com/LayerTwo-Labs/bip300301_enforcer"
91-
rev = "a4197ad2ae9d35252d12008ff616bce710b647d2"
91+
rev = "1100b6085d9ed64eeaf1b57b3c44609626bd4b23"
9292

9393
[workspace.dependencies.bip300301_enforcer_integration_tests]
9494
default-features = false
9595
git = "https://github.com/LayerTwo-Labs/bip300301_enforcer"
96-
rev = "a4197ad2ae9d35252d12008ff616bce710b647d2"
96+
rev = "1100b6085d9ed64eeaf1b57b3c44609626bd4b23"
9797

9898
[workspace.dependencies.l2l-openapi]
9999
git = "https://github.com/Ash-L2L/l2l-openapi"

app/gui/coins/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ impl Coins {
3737
}
3838

3939
pub fn show(&mut self, app: Option<&App>, ui: &mut egui::Ui) {
40-
egui::TopBottomPanel::top("coins_tabs").show(ui.ctx(), |ui| {
40+
egui::Panel::top("coins_tabs").show_inside(ui, |ui| {
4141
ui.horizontal(|ui| {
4242
Tab::iter().for_each(|tab_variant| {
4343
let tab_name = tab_variant.to_string();
4444
ui.selectable_value(&mut self.tab, tab_variant, tab_name);
4545
})
4646
});
4747
});
48-
egui::CentralPanel::default().show(ui.ctx(), |ui| match self.tab {
48+
egui::CentralPanel::default().show_inside(ui, |ui| match self.tab {
4949
Tab::TransferReceive => {
5050
let () = self.transfer_receive.show(app, ui);
5151
}

app/gui/coins/transfer_receive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ impl TransferReceive {
148148
}
149149

150150
pub fn show(&mut self, app: Option<&App>, ui: &mut egui::Ui) {
151-
egui::SidePanel::left("transfer")
152-
.exact_width(ui.available_width() / 2.)
151+
egui::Panel::left("transfer")
152+
.exact_size(ui.available_width() / 2.)
153153
.resizable(false)
154154
.show_inside(ui, |ui| {
155155
ui.vertical_centered(|ui| {

app/gui/console_logs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::sync::{
66
use clap::Parser;
77
use eframe::egui::{
88
self, Key, KeyboardShortcut, Modifiers, ScrollArea, TextEdit, TextStyle,
9-
TopBottomPanel, Widget as _,
9+
Widget as _,
1010
};
1111

1212
use crate::{
@@ -89,7 +89,7 @@ impl ConsoleLogs {
8989
}
9090

9191
pub fn show(&mut self, app: Option<&App>, ui: &mut egui::Ui) {
92-
TopBottomPanel::bottom("command_input").show_inside(ui, |ui| {
92+
egui::Panel::bottom("command_input").show_inside(ui, |ui| {
9393
let command_input = TextEdit::multiline(&mut self.command_input)
9494
.font(TextStyle::Monospace)
9595
.desired_width(f32::INFINITY)

app/gui/mod.rs

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,18 @@ impl EguiApp {
221221
}
222222

223223
impl eframe::App for EguiApp {
224-
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
225-
ctx.request_repaint();
224+
fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
225+
ui.request_repaint();
226226
if let Some(app) = self.app.as_ref()
227227
&& !app.wallet.has_seed().unwrap_or(false)
228228
{
229-
egui::CentralPanel::default().show(ctx, |_ui| {
230-
egui::Window::new("Set Seed").show(ctx, |ui| {
229+
egui::CentralPanel::default().show_inside(ui, |ui| {
230+
egui::Window::new("Set Seed").show(ui, |ui| {
231231
self.set_seed.show(app, ui);
232232
});
233233
});
234234
} else {
235-
egui::TopBottomPanel::top("tabs").show(ctx, |ui| {
235+
egui::Panel::top("tabs").show_inside(ui, |ui| {
236236
ui.horizontal(|ui| {
237237
Tab::iter().for_each(|tab_variant| {
238238
let tab_name = tab_variant.to_string();
@@ -244,26 +244,29 @@ impl eframe::App for EguiApp {
244244
})
245245
});
246246
});
247-
egui::TopBottomPanel::bottom("bottom_panel")
248-
.show(ctx, |ui| self.bottom_panel.show(&mut self.miner, ui));
249-
egui::CentralPanel::default().show(ctx, |ui| match self.tab {
250-
Tab::ParentChain => {
251-
self.parent_chain.show(self.app.as_ref(), ui)
252-
}
253-
Tab::Coins => {
254-
self.coins.show(self.app.as_ref(), ui);
255-
}
256-
Tab::MemPoolExplorer => {
257-
self.mempool_explorer.show(self.app.as_ref(), ui);
258-
}
259-
Tab::BlockExplorer => {
260-
self.block_explorer.show(self.app.as_ref(), ui);
261-
}
262-
Tab::Withdrawals => {
263-
self.withdrawals.show(self.app.as_ref(), ui);
264-
}
265-
Tab::ConsoleLogs => {
266-
self.console_logs.show(self.app.as_ref(), ui);
247+
egui::Panel::bottom("bottom_panel").show_inside(ui, |ui| {
248+
self.bottom_panel.show(&mut self.miner, ui)
249+
});
250+
egui::CentralPanel::default().show_inside(ui, |ui| {
251+
match self.tab {
252+
Tab::ParentChain => {
253+
self.parent_chain.show(self.app.as_ref(), ui)
254+
}
255+
Tab::Coins => {
256+
self.coins.show(self.app.as_ref(), ui);
257+
}
258+
Tab::MemPoolExplorer => {
259+
self.mempool_explorer.show(self.app.as_ref(), ui);
260+
}
261+
Tab::BlockExplorer => {
262+
self.block_explorer.show(self.app.as_ref(), ui);
263+
}
264+
Tab::Withdrawals => {
265+
self.withdrawals.show(self.app.as_ref(), ui);
266+
}
267+
Tab::ConsoleLogs => {
268+
self.console_logs.show(self.app.as_ref(), ui);
269+
}
267270
}
268271
});
269272
}

app/gui/parent_chain/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ impl ParentChain {
3535
}
3636

3737
pub fn show(&mut self, app: Option<&App>, ui: &mut egui::Ui) {
38-
egui::TopBottomPanel::top("parent_chain_tabs").show(ui.ctx(), |ui| {
38+
egui::Panel::top("parent_chain_tabs").show_inside(ui, |ui| {
3939
ui.horizontal(|ui| {
4040
Tab::iter().for_each(|tab_variant| {
4141
let tab_name = tab_variant.to_string();
4242
ui.selectable_value(&mut self.tab, tab_variant, tab_name);
4343
})
4444
});
4545
});
46-
egui::CentralPanel::default().show(ui.ctx(), |ui| match self.tab {
46+
egui::CentralPanel::default().show_inside(ui, |ui| match self.tab {
4747
Tab::Transfer => {
4848
self.transfer.show(app, ui);
4949
}

app/gui/parent_chain/transfer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ pub(super) struct Transfer {
289289

290290
impl Transfer {
291291
pub fn show(&mut self, app: Option<&App>, ui: &mut egui::Ui) {
292-
egui::SidePanel::left("deposit")
293-
.exact_width(ui.available_width() / 2.)
292+
egui::Panel::left("deposit")
293+
.exact_size(ui.available_width() / 2.)
294294
.resizable(false)
295295
.show_inside(ui, |ui| {
296296
ui.vertical_centered(|ui| {

app/rpc_server.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use photon::{
1111
types::{Address, PointedOutput, Txid, WithdrawalBundle},
1212
wallet::Balance,
1313
};
14-
use photon_app_rpc_api::RpcServer;
14+
use photon_app_rpc_api::{GetTransactionResponse, RpcServer};
1515
use tower_http::{
1616
cors::CorsLayer,
1717
request_id::{
@@ -143,6 +143,19 @@ impl RpcServer for RpcServerImpl {
143143
self.app.wallet.get_new_address().map_err(custom_err)
144144
}
145145

146+
async fn get_transaction(
147+
&self,
148+
txid: Txid,
149+
) -> RpcResult<Option<GetTransactionResponse>> {
150+
let res = self
151+
.app
152+
.node
153+
.try_get_transaction(txid)
154+
.map_err(custom_err)?
155+
.map(|(tx, block_hash)| GetTransactionResponse { tx, block_hash });
156+
Ok(res)
157+
}
158+
146159
async fn get_wallet_addresses(&self) -> RpcResult<Vec<Address>> {
147160
let addrs = self.app.wallet.get_addresses().map_err(custom_err)?;
148161
let mut res: Vec<_> = addrs.into_iter().collect();

cli/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ pub enum Command {
4444
},
4545
/// Get a new address
4646
GetNewAddress,
47+
/// Get transaction by txid
48+
GetTransaction { txid: Txid },
4749
/// Get wallet addresses, sorted by base58 encoding
4850
GetWalletAddresses,
4951
/// Get wallet UTXOs
@@ -166,6 +168,10 @@ where
166168
let address = rpc_client.get_new_address().await?;
167169
format!("{address}")
168170
}
171+
Command::GetTransaction { txid } => {
172+
let tx_info = rpc_client.get_transaction(txid).await?;
173+
serde_json::to_string_pretty(&tx_info)?
174+
}
169175
Command::GetWalletAddresses => {
170176
let addresses = rpc_client.get_wallet_addresses().await?;
171177
serde_json::to_string_pretty(&addresses)?

0 commit comments

Comments
 (0)