Skip to content

Commit 98851eb

Browse files
committed
remove accept_server_txids from zingoconfig
1 parent dc64fd8 commit 98851eb

File tree

5 files changed

+8
-19
lines changed

5 files changed

+8
-19
lines changed

darkside-tests/src/chain_generics.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ proptest! {
3636
pub(crate) mod conduct_chain {
3737
//! known issues include
3838
//! - transparent sends do not work
39-
//! - txids are regenerated randomly. zingo can optionally accept_server_txid
39+
//! - txids are regenerated randomly. this means zingo has to do extra work to adjust.
4040
//! - these tests cannot portray the full range of network weather.
4141
4242
use orchard::tree::MerkleHashOrchard;
@@ -65,10 +65,9 @@ pub(crate) mod conduct_chain {
6565
async fn create_faucet(&mut self) -> LightClient {
6666
self.stage_transaction(ABANDON_TO_DARKSIDE_SAP_10_000_000_ZAT)
6767
.await;
68-
let mut zingo_config = self
68+
let zingo_config = self
6969
.client_builder
7070
.make_unique_data_dir_and_load_config(self.regtest_network);
71-
zingo_config.accept_server_txids = true;
7271
LightClient::create_from_wallet_base_async(
7372
WalletBase::MnemonicPhrase(DARKSIDE_SEED.to_string()),
7473
&zingo_config,

darkside-tests/tests/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ async fn evicted_transaction_is_rebroadcast() {
255255

256256
let primary = environment.fund_client_orchard(1_000_000).await;
257257
let secondary = environment.create_client().await;
258-
primary.do_sync(false).await;
258+
primary.do_sync(false).await.unwrap();
259259

260260
let proposal = to_clients_proposal(
261261
&primary,
@@ -275,7 +275,7 @@ async fn evicted_transaction_is_rebroadcast() {
275275
zingolib::testutils::lightclient::list_txids(&primary).await
276276
);
277277

278-
let recorded_fee = *zingolib::testutils::assertions::lookup_fees_with_proposal_check(
278+
let _recorded_fee = *zingolib::testutils::assertions::lookup_fees_with_proposal_check(
279279
&primary, &proposal, txids,
280280
)
281281
.await
@@ -323,7 +323,7 @@ async fn evicted_transaction_is_rebroadcast() {
323323

324324
send_height = 0;
325325

326-
primary.do_sync(false).await;
326+
primary.do_sync(false).await.unwrap();
327327

328328
zingolib::testutils::lightclient::lookup_statuses(&primary, txids.clone())
329329
.await
@@ -335,5 +335,5 @@ async fn evicted_transaction_is_rebroadcast() {
335335
});
336336

337337
let ref_primary: Arc<LightClient> = Arc::new(primary);
338-
LightClient::start_mempool_monitor(ref_primary);
338+
LightClient::start_mempool_monitor(ref_primary).unwrap();
339339
}

zingolib/src/config.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub fn load_clientconfig(
9696
wallet_dir: data_dir,
9797
wallet_name: DEFAULT_WALLET_NAME.into(),
9898
logfile_name: DEFAULT_LOGFILE_NAME.into(),
99-
accept_server_txids: false,
10099
};
101100

102101
Ok(config)
@@ -140,8 +139,6 @@ pub struct ZingoConfigBuilder {
140139
pub wallet_name: Option<PathBuf>,
141140
/// The filename of the logfile. This will be created in the `wallet_dir`.
142141
pub logfile_name: Option<PathBuf>,
143-
/// If this option is enabled, the LightClient will replace outgoing TxId records with the TxId picked by the server. necessary for darkside.
144-
pub accept_server_txids: bool,
145142
}
146143

147144
/// Configuration data that is necessary? and sufficient? for the creation of a LightClient.
@@ -161,8 +158,6 @@ pub struct ZingoConfig {
161158
pub wallet_name: PathBuf,
162159
/// The filename of the logfile. This will be created in the `wallet_dir`.
163160
pub logfile_name: PathBuf,
164-
/// If this option is enabled, the LightClient will replace outgoing TxId records with the TxId picked by the server. necessary for darkside.
165-
pub accept_server_txids: bool,
166161
}
167162

168163
impl ZingoConfigBuilder {
@@ -218,7 +213,6 @@ impl ZingoConfigBuilder {
218213
wallet_dir: self.wallet_dir.clone(),
219214
wallet_name: DEFAULT_WALLET_NAME.into(),
220215
logfile_name: DEFAULT_LOGFILE_NAME.into(),
221-
accept_server_txids: self.accept_server_txids,
222216
}
223217
}
224218
}
@@ -233,7 +227,6 @@ impl Default for ZingoConfigBuilder {
233227
wallet_name: None,
234228
logfile_name: None,
235229
chain: ChainType::Mainnet,
236-
accept_server_txids: false,
237230
}
238231
}
239232
}

zingolib/src/lightclient/send.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ pub mod send_with_proposal {
240240
) {
241241
Ok(reported_txid) => {
242242
// happens during darkside tests
243+
// If this option is enabled, the LightClient will replace outgoing TxId records with the TxId picked by the server. necessary for darkside.
243244
// #[cfg(feature = "darkside_tests")]
244245
// if txid != reported_txid {
245246
// println!(

zingolib/src/testutils/chain_generics/conduct_chain.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ pub trait ConductChain {
2323

2424
/// builds an empty client
2525
async fn create_client(&mut self) -> LightClient {
26-
let mut zingo_config = self.zingo_config();
27-
zingo_config.accept_server_txids = true;
26+
let zingo_config = self.zingo_config();
2827
LightClient::create_from_wallet_base_async(
2928
crate::wallet::WalletBase::FreshEntropy,
3029
&zingo_config,
@@ -37,9 +36,6 @@ pub trait ConductChain {
3736

3837
/// loads a client from bytes
3938
async fn load_client(&mut self, data: &[u8]) -> LightClient {
40-
let mut zingo_config = self.zingo_config();
41-
zingo_config.accept_server_txids = true;
42-
4339
LightClient::create_from_wallet_async(LightWallet::unsafe_from_buffer_testnet(data).await)
4440
.await
4541
.unwrap()

0 commit comments

Comments
 (0)