From 74b9538571f8ad11f381071805ced0999345feab Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Tue, 27 Dec 2022 19:59:13 +0100 Subject: [PATCH] Swapd: Remove local trade role from SwapKeyManager It is unused --- src/swapd/swap_key_manager.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/swapd/swap_key_manager.rs b/src/swapd/swap_key_manager.rs index 2cc25798e..5a5d3e209 100644 --- a/src/swapd/swap_key_manager.rs +++ b/src/swapd/swap_key_manager.rs @@ -87,7 +87,6 @@ impl_strict_encoding!(WrappedEncryptedSignature); #[display("Alice's Swap Key Manager")] pub struct AliceSwapKeyManager { pub alice: Alice, - pub local_trade_role: TradeRole, pub local_params: Parameters, pub key_manager: KeyManager, pub target_bitcoin_address: bitcoin::Address, @@ -97,7 +96,6 @@ pub struct AliceSwapKeyManager { impl Encodable for AliceSwapKeyManager { fn consensus_encode(&self, writer: &mut W) -> Result { let mut len = self.alice.consensus_encode(writer)?; - len += self.local_trade_role.consensus_encode(writer)?; len += self.local_params.consensus_encode(writer)?; len += self.key_manager.consensus_encode(writer)?; len += self @@ -116,7 +114,6 @@ impl Decodable for AliceSwapKeyManager { fn consensus_decode(d: &mut D) -> Result { Ok(AliceSwapKeyManager { alice: Decodable::consensus_decode(d)?, - local_trade_role: Decodable::consensus_decode(d)?, local_params: Decodable::consensus_decode(d)?, key_manager: Decodable::consensus_decode(d)?, target_bitcoin_address: bitcoin::Address::from_canonical_bytes( @@ -134,7 +131,6 @@ impl_strict_encoding!(AliceSwapKeyManager); impl AliceSwapKeyManager { pub fn new( alice: Alice, - local_trade_role: TradeRole, local_params: Parameters, key_manager: KeyManager, target_bitcoin_address: bitcoin::Address, @@ -142,7 +138,6 @@ impl AliceSwapKeyManager { ) -> Self { Self { alice, - local_trade_role, local_params, key_manager, target_bitcoin_address, @@ -155,7 +150,6 @@ impl AliceSwapKeyManager { #[display("Bob's Swap Key Manager")] pub struct BobSwapKeyManager { pub bob: Bob, - pub local_trade_role: TradeRole, pub local_params: Parameters, pub key_manager: KeyManager, pub funding_tx: FundingTx, @@ -166,7 +160,6 @@ pub struct BobSwapKeyManager { impl Encodable for BobSwapKeyManager { fn consensus_encode(&self, writer: &mut W) -> Result { let mut len = self.bob.consensus_encode(writer)?; - len += self.local_trade_role.consensus_encode(writer)?; len += self.local_params.consensus_encode(writer)?; len += self.key_manager.consensus_encode(writer)?; len += self.funding_tx.consensus_encode(writer)?; @@ -186,7 +179,6 @@ impl Decodable for BobSwapKeyManager { fn consensus_decode(d: &mut D) -> Result { Ok(BobSwapKeyManager { bob: Decodable::consensus_decode(d)?, - local_trade_role: Decodable::consensus_decode(d)?, local_params: Decodable::consensus_decode(d)?, key_manager: Decodable::consensus_decode(d)?, funding_tx: Decodable::consensus_decode(d)?, @@ -203,7 +195,6 @@ impl Decodable for BobSwapKeyManager { impl BobSwapKeyManager { pub fn new( bob: Bob, - local_trade_role: TradeRole, local_params: Parameters, key_manager: KeyManager, funding_tx: FundingTx, @@ -212,7 +203,6 @@ impl BobSwapKeyManager { ) -> Self { Self { bob, - local_trade_role, local_params, key_manager, funding_tx, @@ -245,7 +235,6 @@ impl AliceSwapKeyManager { let local_params = alice.generate_parameters(&mut key_manager, &runtime.deal)?; Ok(AliceSwapKeyManager::new( alice, - TradeRole::Taker, local_params, key_manager, // None, @@ -291,10 +280,8 @@ impl AliceSwapKeyManager { ); let local_params = alice.generate_parameters(&mut key_manager, &runtime.deal)?; runtime.log_info(format!("Loading {}", "Alice Swap Key Manager".label())); - let local_trade_role = TradeRole::Maker; Ok(AliceSwapKeyManager::new( alice, - local_trade_role, local_params, key_manager, target_bitcoin_address, @@ -668,7 +655,6 @@ impl BobSwapKeyManager { runtime.log_info(format!("Loading {}", "Bob's Swap Key Manager".label())); Ok(BobSwapKeyManager::new( bob, - TradeRole::Taker, local_params, key_manager, funding, @@ -733,7 +719,6 @@ impl BobSwapKeyManager { runtime.log_info(format!("Loading {}", "Bob's Swap Key Manager".label())); Ok(BobSwapKeyManager::new( bob, - TradeRole::Maker, local_params, key_manager, funding,