diff --git a/processor/src/networks/bitcoin.rs b/processor/src/networks/bitcoin.rs index e28f6ba3..efcea0bb 100644 --- a/processor/src/networks/bitcoin.rs +++ b/processor/src/networks/bitcoin.rs @@ -538,23 +538,23 @@ impl Network for Bitcoin { scanner(keys.group_key()); } - fn address(key: ProjectivePoint) -> Address { + fn external_address(key: ProjectivePoint) -> Address { Address(BAddress::::new(BNetwork::Bitcoin, address_payload(key).unwrap())) } fn branch_address(key: ProjectivePoint) -> Address { let (_, offsets, _) = scanner(key); - Self::address(key + (ProjectivePoint::GENERATOR * offsets[&OutputType::Branch])) + Self::external_address(key + (ProjectivePoint::GENERATOR * offsets[&OutputType::Branch])) } fn change_address(key: ProjectivePoint) -> Address { let (_, offsets, _) = scanner(key); - Self::address(key + (ProjectivePoint::GENERATOR * offsets[&OutputType::Change])) + Self::external_address(key + (ProjectivePoint::GENERATOR * offsets[&OutputType::Change])) } fn forward_address(key: ProjectivePoint) -> Address { let (_, offsets, _) = scanner(key); - Self::address(key + (ProjectivePoint::GENERATOR * offsets[&OutputType::Forwarded])) + Self::external_address(key + (ProjectivePoint::GENERATOR * offsets[&OutputType::Forwarded])) } async fn get_latest_block_number(&self) -> Result { diff --git a/processor/src/networks/mod.rs b/processor/src/networks/mod.rs index 86d19637..3a19e132 100644 --- a/processor/src/networks/mod.rs +++ b/processor/src/networks/mod.rs @@ -293,7 +293,7 @@ pub trait Network: 'static + Send + Sync + Clone + PartialEq + Eq + Debug { fn tweak_keys(key: &mut ThresholdKeys); /// Address for the given group key to receive external coins to. - fn address(key: ::G) -> Self::Address; + fn external_address(key: ::G) -> Self::Address; /// Address for the given group key to use for scheduled branches. fn branch_address(key: ::G) -> Self::Address; /// Address for the given group key to use for change. diff --git a/processor/src/networks/monero.rs b/processor/src/networks/monero.rs index 06aa5a1d..cbc6ac53 100644 --- a/processor/src/networks/monero.rs +++ b/processor/src/networks/monero.rs @@ -475,7 +475,7 @@ impl Network for Monero { // Monero doesn't require/benefit from tweaking fn tweak_keys(_: &mut ThresholdKeys) {} - fn address(key: EdwardsPoint) -> Address { + fn external_address(key: EdwardsPoint) -> Address { Self::address_internal(key, EXTERNAL_SUBADDRESS) } diff --git a/processor/src/tests/addresses.rs b/processor/src/tests/addresses.rs index 8f36f1a5..6fec102f 100644 --- a/processor/src/tests/addresses.rs +++ b/processor/src/tests/addresses.rs @@ -99,7 +99,7 @@ pub async fn test_addresses(network: N) { // Receive funds to the various addresses and make sure they're properly identified let mut received_outputs = vec![]; for (kind, address) in [ - (OutputType::External, N::address(key)), + (OutputType::External, N::external_address(key)), (OutputType::Branch, N::branch_address(key)), (OutputType::Change, N::change_address(key)), (OutputType::Forwarded, N::forward_address(key)), diff --git a/processor/src/tests/scanner.rs b/processor/src/tests/scanner.rs index 747538c0..39e24930 100644 --- a/processor/src/tests/scanner.rs +++ b/processor/src/tests/scanner.rs @@ -49,7 +49,7 @@ pub async fn test_scanner(network: N) { let scanner = new_scanner().await; // Receive funds - let block = network.test_send(N::address(keys.group_key())).await; + let block = network.test_send(N::external_address(keys.group_key())).await; let block_id = block.id(); // Verify the Scanner picked them up diff --git a/processor/src/tests/signer.rs b/processor/src/tests/signer.rs index a16f7097..cdb9f0cd 100644 --- a/processor/src/tests/signer.rs +++ b/processor/src/tests/signer.rs @@ -155,7 +155,7 @@ pub async fn test_signer(network: N) { } let key = keys[&Participant::new(1).unwrap()].group_key(); - let outputs = network.get_outputs(&network.test_send(N::address(key)).await, key).await; + let outputs = network.get_outputs(&network.test_send(N::external_address(key)).await, key).await; let sync_block = network.get_latest_block_number().await.unwrap() - N::CONFIRMATIONS; let amount = 2 * N::DUST; @@ -169,7 +169,7 @@ pub async fn test_signer(network: N) { key, inputs: outputs.clone(), payments: vec![Payment { - address: N::address(key), + address: N::external_address(key), data: None, balance: Balance { coin: match N::NETWORK { diff --git a/processor/src/tests/wallet.rs b/processor/src/tests/wallet.rs index 3c8700c4..c0248c7e 100644 --- a/processor/src/tests/wallet.rs +++ b/processor/src/tests/wallet.rs @@ -44,7 +44,7 @@ pub async fn test_wallet(network: N) { network.mine_block().await; } - let block = network.test_send(N::address(key)).await; + let block = network.test_send(N::external_address(key)).await; let block_id = block.id(); match timeout(Duration::from_secs(30), scanner.events.recv()).await.unwrap().unwrap() { @@ -81,7 +81,7 @@ pub async fn test_wallet(network: N) { &mut txn, outputs.clone(), vec![Payment { - address: N::address(key), + address: N::external_address(key), data: None, balance: Balance { coin: match N::NETWORK { @@ -103,7 +103,7 @@ pub async fn test_wallet(network: N) { key, inputs: outputs.clone(), payments: vec![Payment { - address: N::address(key), + address: N::external_address(key), data: None, balance: Balance { coin: match N::NETWORK {