Skip to content

Commit 92b9597

Browse files
committed
Rename set_current_height to current_height
Usually we don't have any prefix except for methods that can *add* to a list or replace the list entirely (e.g. `add_recipients` vs `set_recipients`)
1 parent 5561057 commit 92b9597

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/wallet/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ pub(crate) mod test {
20672067
.set_sync_time(sync_time)
20682068
.unwrap();
20692069
let current_height = 25;
2070-
builder.set_current_height(current_height);
2070+
builder.current_height(current_height);
20712071
let (psbt, _) = builder.finish().unwrap();
20722072

20732073
// current_height will override the last sync height
@@ -2115,7 +2115,7 @@ pub(crate) mod test {
21152115
let mut builder = wallet.build_tx();
21162116
builder
21172117
.add_recipient(addr.script_pubkey(), 25_000)
2118-
.set_current_height(630_001)
2118+
.current_height(630_001)
21192119
.nlocktime(630_000);
21202120
let (psbt, _) = builder.finish().unwrap();
21212121

@@ -4916,7 +4916,7 @@ pub(crate) mod test {
49164916
let mut builder = wallet.build_tx();
49174917
builder
49184918
.add_recipient(addr.script_pubkey(), balance / 2)
4919-
.set_current_height(confirmation_time);
4919+
.current_height(confirmation_time);
49204920
assert!(matches!(
49214921
builder.finish().unwrap_err(),
49224922
Error::InsufficientFunds {
@@ -4929,7 +4929,7 @@ pub(crate) mod test {
49294929
let mut builder = wallet.build_tx();
49304930
builder
49314931
.add_recipient(addr.script_pubkey(), balance / 2)
4932-
.set_current_height(not_yet_mature_time);
4932+
.current_height(not_yet_mature_time);
49334933
assert!(matches!(
49344934
builder.finish().unwrap_err(),
49354935
Error::InsufficientFunds {
@@ -4942,7 +4942,7 @@ pub(crate) mod test {
49424942
let mut builder = wallet.build_tx();
49434943
builder
49444944
.add_recipient(addr.script_pubkey(), balance / 2)
4945-
.set_current_height(maturity_time);
4945+
.current_height(maturity_time);
49464946
builder.finish().unwrap();
49474947
}
49484948
}

src/wallet/tx_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl<'a, D: BatchDatabase, Cs: CoinSelectionAlgorithm<D>, Ctx: TxBuilderContext>
556556
/// add them using [`TxBuilder::add_utxos`].
557557
///
558558
/// In both cases, if you don't provide a current height, we use the last sync height.
559-
pub fn set_current_height(&mut self, height: u32) -> &mut Self {
559+
pub fn current_height(&mut self, height: u32) -> &mut Self {
560560
self.params.current_height = Some(height);
561561
self
562562
}

0 commit comments

Comments
 (0)