Skip to content

Commit cc618c6

Browse files
authored
Merge pull request #24 from ergoplatform/deleteunused
Delete select_wallet_address
2 parents 8926e95 + b589790 commit cc618c6

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ println!("Current height: {}", node.current_block_height());
3030
Furthermore a number of helper methods are implemented as well, such as:
3131

3232
```rust
33-
/// A CLI interactive interface for prompting a user to select an address
34-
pub fn select_wallet_address(&self) -> Result<P2PKAddressString>
35-
3633

34+
/// Get the current state context of the blockchain
35+
pub fn get_state_context(&self) -> Result<ErgoStateContext>
3736
/// Returns a sorted list of unspent boxes which cover at least the
3837
/// provided value `total` of nanoErgs.
3938
/// Note: This box selection strategy simply uses the largest
@@ -99,4 +98,4 @@ cargo doc --open
9998

10099
Contributing
101100
============
102-
See [CONTRIBUTING](CONTRIBUTING.md)
101+
See [CONTRIBUTING](CONTRIBUTING.md)

src/wallet.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,6 @@ impl NodeInterface {
3030
Ok(addresses)
3131
}
3232

33-
/// A CLI interactive interface for prompting a user to select an address
34-
pub fn select_wallet_address(&self) -> Result<P2PKAddressString> {
35-
let address_list = self.wallet_addresses()?;
36-
if address_list.len() == 1 {
37-
return Ok(address_list[0].clone());
38-
}
39-
40-
let mut n = 0;
41-
for address in &address_list {
42-
n += 1;
43-
println!("{n}. {address}");
44-
}
45-
println!("Which address would you like to select?");
46-
let mut input = String::new();
47-
if std::io::stdin().read_line(&mut input).is_ok() {
48-
if let Ok(input_n) = input.trim().parse::<usize>() {
49-
if input_n > address_list.len() || input_n < 1 {
50-
println!("Please select an address within the range.");
51-
return self.select_wallet_address();
52-
}
53-
return Ok(address_list[input_n - 1].clone());
54-
}
55-
}
56-
self.select_wallet_address()
57-
}
58-
5933
/// Acquires unspent boxes from the node wallet
6034
pub fn unspent_boxes(&self) -> Result<Vec<ErgoBox>> {
6135
let endpoint = "/wallet/boxes/unspent?minConfirmations=0&minInclusionHeight=0";

0 commit comments

Comments
 (0)