Skip to content

Commit

Permalink
fix: rename my_addr to my_address_v2 in CoinAssocTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
laruh committed Apr 5, 2024
1 parent 977cf40 commit b7c2006
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6256,7 +6256,7 @@ impl CoinAssocTypes for EthCoin {
type Sig = Signature;
type SigParseError = MmError<CoinAssocTypesError>;

fn my_addr(&self) -> &Self::Address { &self.my_address }
fn my_address_v2(&self) -> &Self::Address { &self.my_address }

fn parse_address(&self, address: &str) -> Result<Self::Address, Self::AddressParseError> {
Address::from_str(address).map_to_mm(|e| CoinAssocTypesError::InvalidHexString(e.to_string()))
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/lp_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ pub trait CoinAssocTypes {
type Sig: ToBytes + Send + Sync;
type SigParseError: fmt::Debug + Send + fmt::Display;

fn my_addr(&self) -> &Self::Address;
fn my_address_v2(&self) -> &Self::Address;

fn parse_address(&self, address: &str) -> Result<Self::Address, Self::AddressParseError>;

Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/test_coin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ impl CoinAssocTypes for TestCoin {
type Sig = TestSig;
type SigParseError = String;

fn my_addr(&self) -> &Self::Address { todo!() }
fn my_address_v2(&self) -> &Self::Address { todo!() }

fn parse_address(&self, address: &str) -> Result<Self::Address, Self::AddressParseError> { todo!() }

Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/utxo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ impl<T: UtxoCommonOps> CoinAssocTypes for T {
type Sig = Signature;
type SigParseError = MmError<secp256k1::Error>;

fn my_addr(&self) -> &Self::Address {
fn my_address_v2(&self) -> &Self::Address {
match &self.as_ref().derivation_method {
DerivationMethod::SingleAddress(addr) => addr,
unimplemented => unimplemented!("{:?}", unimplemented),
Expand Down
4 changes: 2 additions & 2 deletions mm2src/mm2_main/src/lp_swap/maker_swap_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ impl<MakerCoin: MmCoin + MakerCoinSwapOpsV2, TakerCoin: MmCoin + TakerCoinSwapOp
taker_coin_htlc_pub: state_machine.taker_coin.derive_htlc_pubkey(&unique_data),
maker_coin_swap_contract: state_machine.maker_coin.swap_contract_address().map(|bytes| bytes.0),
taker_coin_swap_contract: state_machine.taker_coin.swap_contract_address().map(|bytes| bytes.0),
taker_coin_address: state_machine.taker_coin.my_addr().to_string(),
taker_coin_address: state_machine.taker_coin.my_address_v2().to_string(),
};
debug!("Sending maker negotiation message {:?}", maker_negotiation_msg);
let swap_msg = SwapMessage {
Expand Down Expand Up @@ -1616,7 +1616,7 @@ impl<MakerCoin: MmCoin + MakerCoinSwapOpsV2, TakerCoin: MmCoin + TakerCoinSwapOp
time_lock: self.negotiation_data.taker_payment_locktime,
maker_secret_hash: &state_machine.secret_hash(),
maker_pub: &state_machine.taker_coin.derive_htlc_pubkey_v2(&unique_data),
maker_address: state_machine.taker_coin.my_addr(),
maker_address: state_machine.taker_coin.my_address_v2(),
taker_pub: &self.negotiation_data.taker_coin_htlc_pub_from_taker,
dex_fee: &state_machine.dex_fee,
premium_amount: Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions mm2src/mm2_main/tests/docker_tests/swap_proto_v2_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ fn send_and_spend_taker_payment_dex_fee_burn() {
time_lock: 0,
maker_secret_hash,
maker_pub,
maker_address: maker_coin.my_addr(),
maker_address: maker_coin.my_address_v2(),
taker_pub,
dex_fee_pub: &DEX_FEE_ADDR_RAW_PUBKEY,
dex_fee,
Expand Down Expand Up @@ -437,7 +437,7 @@ fn send_and_spend_taker_payment_standard_dex_fee() {
time_lock: 0,
maker_secret_hash,
maker_pub,
maker_address: maker_coin.my_addr(),
maker_address: maker_coin.my_address_v2(),
taker_pub,
dex_fee_pub: &DEX_FEE_ADDR_RAW_PUBKEY,
dex_fee,
Expand Down

0 comments on commit b7c2006

Please sign in to comment.