Skip to content

Commit e22256e

Browse files
committed
add editing to p2pool config file
1 parent d3f45d7 commit e22256e

7 files changed

Lines changed: 1445 additions & 130 deletions

File tree

Cargo.lock

Lines changed: 64 additions & 33 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ config = "0.15.19"
1111
crossterm = "0.29.0"
1212
ratatui = "0.29.0"
1313
p2poolv2_config = { git = "https://github.com/p2poolv2/p2poolv2", package = "p2poolv2_config" }
14+
bitcoin = "0.32.5"
15+
toml = "0.8"
16+
toml_edit = "0.22"
1417

1518
[dev-dependencies]
1619
insta = "1.44.3"

src/app.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use crate::bitcoin_config::ConfigEntry as BitcoinEntry;
66
use crate::components::bitcoin_config_view::BitcoinConfigView;
77
use crate::components::file_explorer::FileExplorer;
8+
use crate::components::p2pool_config_view::P2PoolConfigView;
89
use p2poolv2_config::Config as P2PoolConfig;
910
use std::path::PathBuf;
1011

@@ -40,6 +41,10 @@ pub enum AppAction {
4041
CommitEdit(usize, String),
4142
// Saves bitcoin config to disk
4243
SaveBitcoinConfig,
44+
/// Commits an edited p2pool config value: (entry index, new value)
45+
CommitP2PoolEdit(usize, String),
46+
/// Saves p2pool config to disk
47+
SaveP2PoolConfig,
4348
}
4449

4550
pub struct App {
@@ -50,6 +55,7 @@ pub struct App {
5055
pub p2pool_conf_path: Option<PathBuf>,
5156
pub explorer: FileExplorer,
5257
pub bitcoin_config_view: BitcoinConfigView,
58+
pub p2pool_config_view: P2PoolConfigView,
5359
pub p2pool_config: Option<P2PoolConfig>,
5460
pub bitcoin_data: Vec<BitcoinEntry>,
5561
pub bitcoin_status_tab: usize,
@@ -65,6 +71,7 @@ impl App {
6571
p2pool_conf_path: None,
6672
explorer: FileExplorer::new(),
6773
bitcoin_config_view: BitcoinConfigView::new(),
74+
p2pool_config_view: P2PoolConfigView::new(),
6875
p2pool_config: None,
6976
bitcoin_data: Vec::new(),
7077
bitcoin_status_tab: 0,

0 commit comments

Comments
 (0)