Repository: farcaster-project/farcaster-node
Pull request #839 (2022-12-14 22:17:40)

Swapd: state refactors
A bunch of small independent refactors segregated by commits not tracked by open issues. 
The commit 09387540ecce3f9314396ddd29582781a28925b4 (*couple swap role and wallet role when initiating maker*) I'm unsure about, but would like to discuss stronger coupling of swap roles and wallet roles in handling.


Patch:
diff --git a/docs/Home.md b/docs/Home.md
index be405dbb..c474d2f7 100644
--- a/docs/Home.md
+++ b/docs/Home.md
@@ -1,17 +1,17 @@
-You can choose to run the node directly on your machine or inside some containers. For a quick setup, containers might be your best bet assuming you already have Docker setup on your machine.
+You can choose to run the node directly on your machine or inside some containers. For a quick setup, containers might be your best bet assuming you already have Docker setup.
 
 Depending on the chosen installation method:
 
-- continue with [run on your machine](#run-on-your-machine)
-- or [run with docker](#run-with-docker)
+- you now have to continue to [run on your machine](#run-on-your-machine)
+- or continue to [run with docker](#run-with-docker)
 
-They provide instructions on how to launch the swap node, codenamed `farcasterd`, and interact with it with the `swap-cli` command line tool.
+They provide instructions on how to launch the swap node, codenamed `farcasterd`, and interact with it with `swap-cli`.
 
 ## Run on your machine
 
-Follow the instruction in the [Install guide](./Install-guide) to compile sources on your machine, either from the git repo or using `cargo install`. When done you can now launch the services needed for the swap.
+Follow the instruction in the [Install guide](./Install-guide) to compile sources on your machine. When done you can now launch the services needed for the swap.
 
-First you need to run a `monero rpc wallet` to manage in-transit moneroj. If you have it already installed on your machine you can run (we are assuming a testnet swap)
+First you need to run a `monero rpc wallet` to manage in-transit moneroj. If you have it already installed on your machine you can run
 
 ```
 monero-wallet-rpc --stagenet --rpc-bind-port 38083\
@@ -24,31 +24,29 @@ monero-wallet-rpc --stagenet --rpc-bind-port 38083\
 
 or you can use one of our Docker images as described [here](./Using-Docker#run-the-monero-rpc-wallet).
 
-Now that you have a working Monero RPC wallet `farcasterd` can connect to, you can launch the node and follow the logs to see what's happening. Launch the node with `farcasterd` and the rest is automatic
+Now that you have a working Monero RPC wallet to connect you can launch the node, and follow the logs to see what's happening. Launch the node with
 
 ```
 farcasterd
 ```
 
-:mag_right: You can find more details below about the [configuration](#configuration) if you need to customize its behavior.
+:mag_right: You can find more details below about the [configuration](#configuration) if you need to customize some values.
 
-Once `farcasterd` is up & running you can issue commands to control its actions with a client. Within this repo the included client is `swap-cli`, a command line tool that allows you to issue commands. An other alternative is using [Farcaster GUI (beta)](https://github.com/farcaster-project/farcaster-gui), for this you need to follow the instructions and enable the gRPC interface on your node.
+Once `farcasterd` is up & running you can issue commands to control its actions with a client. For the time being, only one client is provided within this repo: `swap-cli`.
 
-If you launched `farcasterd` with the default paramters (the `--data-dir` argument or `-d` will point to the default folder `.farcaster` in you home folder), `swap-cli` will be able to connect to `farcasterd` without further configuration, otherwise make sure you pass the same values to `farcasterd` and `swap-cli`.
-
-You can now get information about the node with the command
+If you launched `farcasterd` with the default paramters (the `--data-dir` argument or `-d` will point to the default folder `.farcaster` in you home folder), `swap-cli` will be able to connect to `farcasterd` without further configuration. You can get information about the node with
 
 ```
 swap-cli info
 ```
 
-Run `swap-cli help` for more details about all the available commands.
+Run `swap-cli help` command for more details about available commands.
 
-Commands you should know: `swap-cli info` gives a general overview of the node, `swap-cli ls` (or `swap-cli list-swaps`) lists the ongoing swaps and `swap-cli progress <swap_id>` give the state of a given swap.
+Commands you should know: `swap-cli info` gives a general overview of the node, `swap-cli ls` lists the ongoing swaps and `swap-cli progress <swap_id>` give the state of a given swap.
 
-With those commands and `farcasterd` logs you should be able to follow the state of your swaps.
+With those commands and `farcasterd` logs you should be able to follow your swaps.
 
-Check out the documentation on configuration and usage for more advanced setups and to learn how to make and take deals.
+Check out the documentation on configuration and usage for more advanced setups and to learn how to make and take offers.
 
 ## Run with docker
 
@@ -70,7 +68,7 @@ Check out the documentation on configuration and usage for more advanced setups
 
 **Syncers**
 
-This section configures the daemons' connection URLs for the three possible networks: _mainnet_, _testnet_, _local_:
+This entry configures the daemons' connection URLs for the three possible networks: _mainnet_, _testnet_, _local_:
 
 ```toml
 [syncers.{network}]
@@ -79,13 +77,13 @@ monero_daemon = ""
 monero_rpc_wallet = ""
 ```
 
-:mag_right: The default config for _local_ network is set to `null`, this network is used by the developers and you can ignore it.
+:mag_right: The default config for _local_ network is set to `null`.
 
 ### Use public infrastructure
 
 To help quickly test and avoid running the entire infrastructure on your machine, you can make use of public nodes. Following is a non-exhaustive list of public nodes.
 
-Only blockchain daemons and electrum servers are listed, you should always run your own `monero rpc wallet` locally.
+Only blockchain daemons and electrum servers are listed, you should always run your own `monero rpc wallet`.
 
 **Mainnet**
 
diff --git a/docs/Run-local-swap.md b/docs/Run-local-swap.md
index 51bd8c99..afe28b32 100644
--- a/docs/Run-local-swap.md
+++ b/docs/Run-local-swap.md
@@ -2,11 +2,11 @@ This document describes how to test a swap running both participants locally.
 
 You'll need to [build and install](./Install-guide) the node locally.
 
-We'll create two node instances and will make them running a testnet swap, for that make sure to have access to the three services: an `electrum server` (can use a public one from default config), a `monero daemon` (can use a public one from default config), and a `monero rpc wallet` (needs to run locally).
+We'll create two node instances and will make them running a swap, for that make sure to have access to the three services: an `electrum server`, a `monero daemon`, and a `monero rpc wallet`.
 
 ## Run monero rpc wallet with Docker
 
-:warning: You should run two `monero rpc wallet`, one for each `farcasterd` services, choose different ports and modify `--rpc-bind-port` and `-p` values accordingly. Pull the latest image and launch two containers:
+:warning: You should run two containers, one for each `farcasterd` services, choose different ports and modify `--rpc-bind-port` and `-p` values accordingly. Pull the latest image and launch two containers:
 
 ```
 docker pull ghcr.io/farcaster-project/containers/monero-wallet-rpc:latest
@@ -48,11 +48,11 @@ Then launch two `farcasterd` services:
 farcasterd --data-dir {.node01|.node02}
 ```
 
-You can use other public daemons for configuring your syncers, see the default values in [:bulb: Use public infrastructure](./Home#bulb-use-public-infrastructure).
+You can use other public daemons for syncers, see [:bulb: Use public infrastructure](./Home#bulb-use-public-infrastructure) for more details.
 
 ## Configure swap-cli clients
 
-For simplicity you can create two aliases for the `swap-cli`, you will use them to make and take deals:
+For simplicity you can create two aliases for the `swap-cli`, you will use them to make and take offers:
 
 ```
 alias swap1-cli="swap-cli -d .node01"
@@ -63,9 +63,9 @@ alias swap2-cli="swap-cli -d .node02"
 
 You need to have access to Bitcoin (testnet) and Monero (stagenet) test coins, use your wallet of choice. You just need a way to fund the swap in bitcoins and moneroj.
 
-## Make a deal
+## Make the offer
 
-Maker creates deals. The serialized representation (like an address but longer) of the deal shall be shared with a taker.
+Maker creates offer and start listening. Command used to print a serialized representation of the offer that shall be shared with taker. Additionally it spins up the listener awaiting for connection related to this offer (bound on `0.0.0.0:9735` by default, with an offer public address of `127.0.0.1:9735` by default).
 
 ```
 swap1-cli make --btc-addr tb1q4gj53tuew3e6u4a32kdtle2q72su8te39dpceq\
@@ -74,27 +74,27 @@ swap1-cli make --btc-addr tb1q4gj53tuew3e6u4a32kdtle2q72su8te39dpceq\
     --xmr-amount "0.001 XMR"
 ```
 
-The command will create a deal based on the chosen parameters, spin up a listening `peerd` (bound to `0.0.0.0:7067` on your machine by default), and return the encoded deal (starting with `Deal:...`).
+The command will create a public offer based on the chosen parameters, spin up a listening `peerd` (in that case `0.0.0.0:9735`), and return the encoded offer (starting with `Offer:...`).
 
-This deal should be shared by maker with taker. It contains information on how to connect to the maker (a public address of `127.0.0.1:7067` by default). Additionally, it adds the deal to the set of deals available in `farcasterd` that will be later used to initiate the swap upon requests from takers.
+This public offer should be shared by maker with taker. It also contains information on how to connect to maker (in that case `127.0.0.1:9735`). Additionally, it adds the public offers to the set of public offers in `farcasterd` that will be later used to initiate the swap upon requests from takers.
 
 To get a detailed explanation of `make` and more details on all possible arguments you can run `swap1-cli make --help`.
 
-## Take a deal
+## Take an offer
 
-Taker accepts deals and connects to maker's daemon node with the following command (run `swap2-cli take --help` for more details):
+Taker accepts offer and connects to maker's daemon node with the following command (run `swap2-cli take --help` for more details):
 
-Example of taking the deal above produced by maker:
+Example of taking the offer above produced by maker:
 
 ```
 swap2-cli take --btc-addr tb1qt3r3t6yultt8ne88ffgvgyym0sstj4apwsz05j\
     --xmr-addr 54EYTy2HYFcAXwAbFQ3HmAis8JLNmxRdTC9DwQL7sGJd4CAUYimPxuQHYkMNg1EELNP85YqFwqraLd4ovz6UeeekFLoCKiu\
-    --deal Deal:...
+    --offer Offer:...
 ```
 
-The `--btc-addr` argument is the Bitcoin destination address in case the bitcoins need to be refunded or if the swap completes (depending on the trade you're doing), the `--xmr-addr` for Monero, and finally the deal with `--deal` or `-D`.
+The `--btc-addr` argument is the Bitcoin destination address in case the bitcoins need to be refunded or if the swap completes (depending on the swap role), the `--xmr-addr` for Monero, and finally the offer with `--offer` or `-o`.
 
-Upon taking the deal, its deserialized content is printed and the user is asked for validation with `y` or `n`.
+Upon taking the public offer, its deserialized content is printed and the user is asked for validation with `y` or `n`.
 
 :mag_right: Flag of interest: `--without-validation` or `-w`, for externally validated automated setups (skip validation in cli).
 
diff --git a/src/grpcd/proto/farcaster.proto b/src/grpcd/proto/farcaster.proto
index 6c4f0f39..7be2b3dc 100644
--- a/src/grpcd/proto/farcaster.proto
+++ b/src/grpcd/proto/farcaster.proto
@@ -23,14 +23,14 @@ service Farcaster {
 
 message HealthCheckRequest {
     uint32 id = 1;
-    NetworkSelector selector = 2;
+    HealthCheckSelector selector = 2;
 }
 
-enum NetworkSelector {
-    ALL_NETWORKS = 0;
-    MAINNET_NETWORKS = 1;
-    TESTNET_NETWORKS = 2;
-    LOCAL_NETWORKS = 3;
+enum HealthCheckSelector {
+    CHECK_ALL = 0;
+    CHECK_MAINNET = 1;
+    CHECK_TESTNET = 2;
+    CHECK_LOCAL = 3;
 }
 
 message HealthCheckResponse {
@@ -124,8 +124,7 @@ message PeersResponse {
 
 message ListOffersRequest {
     uint32 id = 1;
-    OfferSelector offer_selector = 2;
-    NetworkSelector network_selector = 3;
+    OfferSelector selector = 2;
 }
 
 enum OfferSelector {
@@ -142,8 +141,7 @@ message ListOffersResponse {
 
 message CheckpointsRequest {
     uint32 id = 1;
-    CheckpointSelector checkpoint_selector = 2;
-    NetworkSelector network_selector = 3;
+    CheckpointSelector selector = 2;
 }
 
 message CheckpointsResponse {
@@ -180,7 +178,6 @@ message RestoreCheckpointResponse {
 message FundingAddressesRequest {
     uint32 id = 1;
     Blockchain blockchain = 2;
-    NetworkSelector network_selector = 3;
 }
 
 message FundingAddressesResponse {
@@ -323,7 +320,6 @@ message ConnectSwapResponse {
 message NeedsFundingRequest {
     uint32 id = 1;
     Blockchain blockchain = 2;
-    NetworkSelector network_selector = 3;
 }
 
 message NeedsFundingResponse {
diff --git a/src/grpcd/runtime.rs b/src/grpcd/runtime.rs
index fe62f620..9d8426d8 100644
--- a/src/grpcd/runtime.rs
+++ b/src/grpcd/runtime.rs
@@ -16,7 +16,6 @@ use crate::bus::Failure;
 use crate::bus::HealthCheckSelector;
 use crate::bus::OptionDetails;
 use crate::bus::Outcome;
-use crate::grpcd::runtime::farcaster::NetworkSelector;
 use crate::service::Endpoints;
 use crate::swapd::StateReport;
 use crate::syncerd::SweepAddressAddendum;
@@ -98,17 +97,6 @@ impl From<farcaster::Network> for Network {
     }
 }
 
-impl From<NetworkSelector> for Option<Network> {
-    fn from(t: NetworkSelector) -> Option<Network> {
-        match t {
-            NetworkSelector::AllNetworks => None,
-            NetworkSelector::MainnetNetworks => Some(Network::Mainnet),
-            NetworkSelector::TestnetNetworks => Some(Network::Testnet),
-            NetworkSelector::LocalNetworks => Some(Network::Local),
-        }
-    }
-}
-
 impl From<Network> for farcaster::Network {
     fn from(t: Network) -> farcaster::Network {
         match t {
@@ -148,23 +136,6 @@ impl From<farcaster::OfferSelector> for OfferStatusSelector {
     }
 }
 
-impl From<FundingInfo> for farcaster::FundingInfo {
-    fn from(t: FundingInfo) -> farcaster::FundingInfo {
-        match t {
-            FundingInfo::Bitcoin(b_info) => farcaster::FundingInfo {
-                swap_id: b_info.swap_id.to_string(),
-                address: b_info.address.to_string(),
-                amount: b_info.amount.as_sat(),
-            },
-            FundingInfo::Monero(m_info) => farcaster::FundingInfo {
-                swap_id: m_info.swap_id.to_string(),
-                address: m_info.address.to_string(),
-                amount: m_info.amount.as_pico(),
-            },
-        }
-    }
-}
-
 impl From<Outcome> for farcaster::Outcome {
     fn from(t: Outcome) -> farcaster::Outcome {
         match t {
@@ -379,17 +350,17 @@ impl From<StateReport> for farcaster::State {
     }
 }
 
-impl From<farcaster::NetworkSelector> for HealthCheckSelector {
-    fn from(s: farcaster::NetworkSelector) -> Self {
+impl From<farcaster::HealthCheckSelector> for HealthCheckSelector {
+    fn from(s: farcaster::HealthCheckSelector) -> Self {
         match s {
-            farcaster::NetworkSelector::AllNetworks => HealthCheckSelector::All,
-            farcaster::NetworkSelector::LocalNetworks => {
+            farcaster::HealthCheckSelector::CheckAll => HealthCheckSelector::All,
+            farcaster::HealthCheckSelector::CheckLocal => {
                 HealthCheckSelector::Network(Network::Local)
             }
-            farcaster::NetworkSelector::MainnetNetworks => {
+            farcaster::HealthCheckSelector::CheckMainnet => {
                 HealthCheckSelector::Network(Network::Mainnet)
             }
-            farcaster::NetworkSelector::TestnetNetworks => {
+            farcaster::HealthCheckSelector::CheckTestnet => {
                 HealthCheckSelector::Network(Network::Testnet)
             }
         }
@@ -565,18 +536,14 @@ impl Farcaster for FarcasterService {
         debug!("Received a grpc request: {:?}", request);
         let ListOffersRequest {
             id,
-            offer_selector: grpc_offer_selector,
-            network_selector: grpc_network_selector,
+            selector: grpc_offer_selector,
         } = request.into_inner();
-        let offer_selector = farcaster::OfferSelector::from_i32(grpc_offer_selector)
-            .ok_or(Status::invalid_argument("offer_selector"))?
+        let selector = farcaster::OfferSelector::from_i32(grpc_offer_selector)
+            .ok_or(Status::invalid_argument("selector"))?
             .into();
-        let network_selector: NetworkSelector =
-            farcaster::NetworkSelector::from_i32(grpc_network_selector)
-                .ok_or(Status::invalid_argument("network_selector"))?;
         let oneshot_rx = self
             .process_request(BusMsg::Bridge(BridgeMsg::Info {
-                request: InfoMsg::ListOffers(offer_selector),
+                request: InfoMsg::ListOffers(selector),
                 service_id: ServiceId::Farcasterd,
             }))
             .await?;
@@ -586,10 +553,6 @@ impl Farcaster for FarcasterService {
                     id,
                     offers: offers
                         .drain(..)
-                        .filter(|o| {
-                            network_selector == NetworkSelector::AllNetworks
-                                || Some(o.details.offer.network) == network_selector.into()
-                        })
                         .map(|o| OfferInfo::from(o.details))
                         .collect(),
                 };
@@ -632,21 +595,13 @@ impl Farcaster for FarcasterService {
         request: GrpcRequest<CheckpointsRequest>,
     ) -> Result<GrpcResponse<CheckpointsResponse>, Status> {
         debug!("Received a grpc checkpoints request: {:?}", request);
-        let CheckpointsRequest {
-            id,
-            checkpoint_selector: grpc_checkpoint_selector,
-            network_selector: grpc_network_selector,
-        } = request.into_inner();
+        let CheckpointsRequest { id, selector } = request.into_inner();
 
-        let checkpoint_selector = farcaster::CheckpointSelector::from_i32(grpc_checkpoint_selector)
-            .ok_or(Status::invalid_argument("checkpoint_selector"))?
+        let selector = farcaster::CheckpointSelector::from_i32(selector)
+            .ok_or(Status::invalid_argument("selector"))?
             .into();
 
-        let network_selector: NetworkSelector =
-            farcaster::NetworkSelector::from_i32(grpc_network_selector)
-                .ok_or(Status::invalid_argument("network_selector"))?;
-
-        let oneshot_rx = match checkpoint_selector {
+        let oneshot_rx = match selector {
             farcaster::CheckpointSelector::AllCheckpoints => {
                 self.process_request(BusMsg::Bridge(BridgeMsg::Info {
                     request: InfoMsg::RetrieveAllCheckpointInfo,
@@ -688,10 +643,6 @@ impl Farcaster for FarcasterService {
                     id,
                     checkpoint_entries: checkpoint_entries
                         .iter()
-                        .filter(|entry| {
-                            network_selector == NetworkSelector::AllNetworks
-                                || Some(entry.public_offer.offer.network) == network_selector.into()
-                        })
                         .map(|entry| farcaster::CheckpointEntry {
                             swap_id: format!("{:#x}", entry.swap_id),
                             offer: Some(entry.public_offer.clone().into()),
@@ -756,17 +707,12 @@ impl Farcaster for FarcasterService {
         let FundingAddressesRequest {
             id,
             blockchain: grpc_blockchain,
-            network_selector: grpc_network_selector,
         } = request.into_inner();
 
         let blockchain: Blockchain = farcaster::Blockchain::from_i32(grpc_blockchain)
             .ok_or(Status::invalid_argument("arbitrating blockchain"))?
             .into();
 
-        let network_selector: NetworkSelector =
-            farcaster::NetworkSelector::from_i32(grpc_network_selector)
-                .ok_or(Status::invalid_argument("network_selector"))?;
-
         let oneshot_rx = self
             .process_request(BusMsg::Bridge(BridgeMsg::Info {
                 request: InfoMsg::GetAddresses(blockchain),
@@ -779,10 +725,6 @@ impl Farcaster for FarcasterService {
                     id,
                     addresses: addresses
                         .iter()
-                        .filter(|a| {
-                            network_selector == NetworkSelector::AllNetworks
-                                || Some(Network::from(a.address.network)) == network_selector.into()
-                        })
                         .map(|a| AddressSwapIdPair {
                             address: a.address.to_string(),
                             address_swap_id: a.swap_id.map(|c| {
@@ -1080,17 +1022,12 @@ impl Farcaster for FarcasterService {
         let NeedsFundingRequest {
             id,
             blockchain: int_blockchain,
-            network_selector: grpc_network_selector,
         } = request.into_inner();
 
         let blockchain: Blockchain = farcaster::Blockchain::from_i32(int_blockchain)
             .ok_or(Status::invalid_argument("blockchain"))?
             .into();
 
-        let network_selector: NetworkSelector =
-            farcaster::NetworkSelector::from_i32(grpc_network_selector)
-                .ok_or(Status::invalid_argument("network_selector"))?;
-
         let oneshot_rx = self
             .process_request(BusMsg::Bridge(BridgeMsg::Info {
                 request: InfoMsg::NeedsFunding(blockchain),
@@ -1099,26 +1036,24 @@ impl Farcaster for FarcasterService {
             .await?;
 
         match oneshot_rx.await {
-            Ok(BusMsg::Info(InfoMsg::FundingInfos(mut infos))) => {
+            Ok(BusMsg::Info(InfoMsg::FundingInfos(infos))) => {
                 let reply = NeedsFundingResponse {
                     id,
                     funding_infos: infos
                         .swaps_need_funding
-                        .drain(..)
-                        .filter(|info| {
-                            network_selector == NetworkSelector::AllNetworks
-                                || match info {
-                                    FundingInfo::Bitcoin(b_info) => {
-                                        Some(Network::from(b_info.address.network))
-                                            == network_selector.into()
-                                    }
-                                    FundingInfo::Monero(m_info) => {
-                                        Some(Network::from(m_info.address.network))
-                                            == network_selector.into()
-                                    }
-                                }
+                        .iter()
+                        .map(|info| match info {
+                            FundingInfo::Bitcoin(b_info) => farcaster::FundingInfo {
+                                swap_id: b_info.swap_id.to_string(),
+                                address: b_info.address.to_string(),
+                                amount: b_info.amount.as_sat(),
+                            },
+                            FundingInfo::Monero(m_info) => farcaster::FundingInfo {
+                                swap_id: m_info.swap_id.to_string(),
+                                address: m_info.address.to_string(),
+                                amount: m_info.amount.as_pico(),
+                            },
                         })
-                        .map(farcaster::FundingInfo::from)
                         .collect(),
                 };
                 Ok(GrpcResponse::new(reply))
@@ -1136,7 +1071,7 @@ impl Farcaster for FarcasterService {
             selector: grpc_selector,
         } = request.into_inner();
 
-        let selector: HealthCheckSelector = farcaster::NetworkSelector::from_i32(grpc_selector)
+        let selector: HealthCheckSelector = farcaster::HealthCheckSelector::from_i32(grpc_selector)
             .ok_or(Status::invalid_argument("selector"))?
             .into();
 
diff --git a/src/swapd/swap_state.rs b/src/swapd/swap_state.rs
index 05586b1a..36a52fe1 100644
--- a/src/swapd/swap_state.rs
+++ b/src/swapd/swap_state.rs
@@ -9,6 +9,7 @@ use farcaster_core::{
     blockchain::Blockchain,
     role::{SwapRole, TradeRole},
     swap::btcxmr::message::BuyProcedureSignature,
+    transaction::Fundable,
     transaction::TxLabel,
 };
 use microservices::esb::Handler;
@@ -32,7 +33,7 @@ use crate::{
     swapd::{
         runtime::aggregate_xmr_spend_view,
         syncer_client::{log_tx_created, log_tx_seen},
-        wallet::{HandleBuyProcedureSignatureRes, HandleRefundProcedureSignaturesRes},
+        wallet::{BobState, HandleBuyProcedureSignatureRes, HandleRefundProcedureSignaturesRes},
     },
     syncerd::{
         Abort, Boolean, SweepSuccess, Task, TaskTarget, TransactionConfirmations,
@@ -540,7 +541,7 @@ impl StateMachine<Runtime, Error> for SwapStateMachine {
             }
             SwapStateMachine::AlicePunish => try_alice_punish_to_swap_end(event, runtime),
 
-            _ => Ok(Some(self)),
+            SwapStateMachine::SwapEnd(_) => Ok(None),
         }
     }
 
@@ -694,7 +695,6 @@ fn attempt_transition_to_init_maker(
                 commit.clone(),
             )?;
             let local_params = wallet.local_params();
-            let funding_address = wallet.funding_address();
             runtime.peer_service = peerd;
             if runtime.peer_service != ServiceId::Loopback {
                 runtime.connected = true;
@@ -715,20 +715,33 @@ fn attempt_transition_to_init_maker(
             // send maker commit message to counter-party
             runtime.log_trace(format!("sending peer MakerCommit msg {}", &local_commit));
             runtime.send_peer(event.endpoints, PeerMsg::MakerCommit(local_commit.clone()))?;
-            match swap_role {
-                SwapRole::Bob => Ok(Some(SwapStateMachine::BobInitMaker(BobInitMaker {
-                    local_commit,
-                    local_params,
-                    funding_address: funding_address.unwrap(),
-                    remote_commit: commit,
-                    wallet,
-                    reveal: None,
-                }))),
-                SwapRole::Alice => Ok(Some(SwapStateMachine::AliceInitMaker(AliceInitMaker {
-                    local_params,
-                    remote_commit: commit,
-                    wallet,
-                }))),
+            match (swap_role, wallet.clone()) {
+                (SwapRole::Bob, Wallet::Bob(BobState { funding_tx, .. })) => {
+                    Ok(Some(SwapStateMachine::BobInitMaker(BobInitMaker {
+                        local_commit,
+                        local_params,
+                        funding_address: funding_tx
+                            .get_address()
+                            .expect("Funding address should be valid"),
+                        remote_commit: commit,
+                        wallet,
+                        reveal: None,
+                    })))
+                }
+                (SwapRole::Alice, Wallet::Alice(_)) => {
+                    Ok(Some(SwapStateMachine::AliceInitMaker(AliceInitMaker {
+                        local_params,
+                        remote_commit: commit,
+                        wallet,
+                    })))
+                }
+                _ => {
+                    runtime.log_error(format!(
+                        "Invalid swap role {} for wallet {}",
+                        swap_role, wallet
+                    ));
+                    Ok(None)
+                }
             }
         }
         BusMsg::Ctl(CtlMsg::AbortSwap) => handle_abort_swap(event, runtime),
@@ -974,14 +987,12 @@ fn try_bob_reveal_to_bob_funded(
             .zip([TxLabel::Lock, TxLabel::Cancel, TxLabel::Refund])
             {
                 runtime.log_debug(format!("register watch {} tx", tx_label.label()));
-                if !runtime.syncer_state.is_watched_tx(&tx_label) {
-                    let txid = tx.clone().extract_tx().txid();
-                    let task = runtime.syncer_state.watch_tx_btc(txid, tx_label);
-                    event.send_sync_service(
-                        runtime.syncer_state.bitcoin_syncer(),
-                        SyncMsg::Task(task),
-                    )?;
-                }
+                let txid = tx.clone().extract_tx().txid();
+                let task = runtime.syncer_state.watch_tx_btc(txid, tx_label);
+                event.send_sync_service(
+                    runtime.syncer_state.bitcoin_syncer(),
+                    SyncMsg::Task(task),
+                )?;
             }
 
             // Set the monero address creation height for Bob before setting the first checkpoint
@@ -1066,16 +1077,11 @@ fn try_bob_funded_to_bob_refund_procedure_signature(
             // register a watch task for buy tx.
             // registration performed now already to ensure it's present in checkpoint.
             runtime.log_debug("register watch buy tx task");
-            if !runtime.syncer_state.is_watched_tx(&TxLabel::Buy) {
-                let buy_tx = buy_procedure_signature.buy.clone().extract_tx();
-                let task = runtime
-                    .syncer_state
-                    .watch_tx_btc(buy_tx.txid(), TxLabel::Buy);
-                event.send_sync_service(
-                    runtime.syncer_state.bitcoin_syncer(),
-                    SyncMsg::Task(task),
-                )?;
-            }
+            let buy_tx = buy_procedure_signature.buy.clone().extract_tx();
+            let task = runtime
+                .syncer_state
+                .watch_tx_btc(buy_tx.txid(), TxLabel::Buy);
+            event.send_sync_service(runtime.syncer_state.bitcoin_syncer(), SyncMsg::Task(task))?;
             // Checkpoint BobRefundProcedureSignatures
             let new_ssm =
                 SwapStateMachine::BobRefundProcedureSignatures(BobRefundProcedureSignatures {
@@ -1132,13 +1138,11 @@ fn try_bob_refund_procedure_signatures_to_bob_accordant_lock(
             }
             if let Some(tx_label) = runtime.syncer_state.tasks.watched_addrs.remove(&id) {
                 let abort_task = runtime.syncer_state.abort_task(id.clone());
-                if !runtime.syncer_state.is_watched_tx(&tx_label) {
-                    let watch_tx = runtime.syncer_state.watch_tx_xmr(hash.clone(), tx_label);
-                    event.send_sync_service(
-                        runtime.syncer_state.monero_syncer(),
-                        SyncMsg::Task(watch_tx),
-                    )?;
-                }
+                let watch_tx = runtime.syncer_state.watch_tx_xmr(hash.clone(), tx_label);
+                event.send_sync_service(
+                    runtime.syncer_state.monero_syncer(),
+                    SyncMsg::Task(watch_tx),
+                )?;
                 event.send_sync_service(
                     runtime.syncer_state.monero_syncer(),
                     SyncMsg::Task(abort_task),
@@ -1457,14 +1461,12 @@ fn try_alice_reveal_to_alice_core_arbitrating_setup(
                 TxLabel::Refund,
             ]) {
                 runtime.log_debug(format!("Register watch {} tx", tx_label));
-                if !runtime.syncer_state.is_watched_tx(&tx_label) {
-                    let txid = tx.clone().extract_tx().txid();
-                    let task = runtime.syncer_state.watch_tx_btc(txid, tx_label);
-                    event.send_sync_service(
-                        runtime.syncer_state.bitcoin_syncer(),
-                        SyncMsg::Task(task),
-                    )?;
-                }
+                let txid = tx.clone().extract_tx().txid();
+                let task = runtime.syncer_state.watch_tx_btc(txid, tx_label);
+                event.send_sync_service(
+                    runtime.syncer_state.bitcoin_syncer(),
+                    SyncMsg::Task(task),
+                )?;
             }
             // handle the core arbitrating setup message with the wallet
             runtime.log_debug("Handling core arb setup with wallet");
@@ -1653,18 +1655,15 @@ fn try_alice_arbitrating_lock_final_to_alice_accordant_lock(
                 id, hash, amount, block, tx
             ));
             let txlabel = TxLabel::AccLock;
-            if !runtime.syncer_state.is_watched_tx(&txlabel) {
-                let task = runtime.syncer_state.watch_tx_xmr(hash.clone(), txlabel);
-                if runtime.syncer_state.awaiting_funding {
-                    event.send_ctl_service(
-                        ServiceId::Farcasterd,
-                        CtlMsg::FundingCompleted(Blockchain::Monero),
-                    )?;
-                    runtime.syncer_state.awaiting_funding = false;
-                }
-                event
-                    .send_sync_service(runtime.syncer_state.monero_syncer(), SyncMsg::Task(task))?;
+            let task = runtime.syncer_state.watch_tx_xmr(hash.clone(), txlabel);
+            if runtime.syncer_state.awaiting_funding {
+                event.send_ctl_service(
+                    ServiceId::Farcasterd,
+                    CtlMsg::FundingCompleted(Blockchain::Monero),
+                )?;
+                runtime.syncer_state.awaiting_funding = false;
             }
+            event.send_sync_service(runtime.syncer_state.monero_syncer(), SyncMsg::Task(task))?;
             if runtime
                 .syncer_state
                 .tasks
@@ -1731,14 +1730,9 @@ fn try_alice_accordant_lock_to_alice_buy_procedure_signature(
         BusMsg::P2p(PeerMsg::BuyProcedureSignature(buy_procedure_signature)) => {
             // register a watch task for buy
             runtime.log_debug("Registering watch buy tx task");
-            if !runtime.syncer_state.is_watched_tx(&TxLabel::Buy) {
-                let txid = buy_procedure_signature.buy.clone().extract_tx().txid();
-                let task = runtime.syncer_state.watch_tx_btc(txid, TxLabel::Buy);
-                event.send_sync_service(
-                    runtime.syncer_state.bitcoin_syncer(),
-                    SyncMsg::Task(task),
-                )?;
-            }
+            let txid = buy_procedure_signature.buy.clone().extract_tx().txid();
+            let task = runtime.syncer_state.watch_tx_btc(txid, TxLabel::Buy);
+            event.send_sync_service(runtime.syncer_state.bitcoin_syncer(), SyncMsg::Task(task))?;
             // Handle the received buy procedure signature message with the wallet
             runtime.log_debug("Handling buy procedure signature with wallet");
             let HandleBuyProcedureSignatureRes { cancel_tx, buy_tx } = wallet
@@ -1873,14 +1867,12 @@ fn try_alice_canceled_to_alice_refund_or_alice_punish(
                     runtime.log_debug("Publishing punish tx");
                     let (tx_label, punish_tx) = runtime.txs.remove_entry(&TxLabel::Punish).unwrap();
                     // syncer's watch punish tx task
-                    if !runtime.syncer_state.is_watched_tx(&tx_label) {
-                        let txid = punish_tx.txid();
-                        let task = runtime.syncer_state.watch_tx_btc(txid, tx_label);
-                        event.send_sync_service(
-                            runtime.syncer_state.bitcoin_syncer(),
-                            SyncMsg::Task(task),
-                        )?;
-                    }
+                    let txid = punish_tx.txid();
+                    let task = runtime.syncer_state.watch_tx_btc(txid, tx_label);
+                    event.send_sync_service(
+                        runtime.syncer_state.bitcoin_syncer(),
+                        SyncMsg::Task(task),
+                    )?;
                     runtime.broadcast(punish_tx, tx_label, event.endpoints)?;
                     Ok(Some(SwapStateMachine::AlicePunish))
                 }
@@ -2066,8 +2058,14 @@ fn try_alice_punish_to_swap_end(
 ) -> Result<Option<SwapStateMachine>, Error> {
     match event.request {
         BusMsg::Sync(SyncMsg::Event(SyncEvent::TransactionConfirmations(
-            TransactionConfirmations { id, .. },
-        ))) if runtime.syncer_state.tasks.watched_txs.get(&id) == Some(&TxLabel::Punish) => {
+            TransactionConfirmations {
+                id,
+                confirmations: Some(confirmations),
+                ..
+            },
+        ))) if runtime.syncer_state.tasks.watched_txs.get(&id) == Some(&TxLabel::Punish)
+            && confirmations >= runtime.temporal_safety.btc_finality_thr =>
+        {
             let abort_all = Task::Abort(Abort {
                 task_target: TaskTarget::AllTasks,
                 respond: Boolean::False,
diff --git a/src/swapd/syncer_client.rs b/src/swapd/syncer_client.rs
index e595d175..8f5a9feb 100644
--- a/src/swapd/syncer_client.rs
+++ b/src/swapd/syncer_client.rs
@@ -114,6 +114,13 @@ impl SyncerState {
     }
 
     pub fn watch_tx_btc(&mut self, txid: Txid, tx_label: TxLabel) -> Task {
+        if self.is_watched_tx(&tx_label) {
+            warn!(
+                "{} | Already watching for tx with label {} - notifications will be repeated",
+                self.swap_id.swap_id(),
+                tx_label.label()
+            );
+        }
         let id = self.tasks.new_taskid();
         self.tasks.watched_txs.insert(id, tx_label);
         self.tasks.txids.insert(tx_label, txid);
@@ -136,6 +143,13 @@ impl SyncerState {
         self.tasks.watched_txs.values().any(|tx| tx == tx_label)
     }
     pub fn watch_tx_xmr(&mut self, hash: Vec<u8>, tx_label: TxLabel) -> Task {
+        if self.is_watched_tx(&tx_label) {
+            warn!(
+                "{} | Already watching for tx with label {} - notifications will be repeated",
+                self.swap_id.swap_id(),
+                tx_label.label()
+            );
+        }
         let id = self.tasks.new_taskid();
         self.tasks.watched_txs.insert(id, tx_label);
         info!(
diff --git a/src/swapd/wallet.rs b/src/swapd/wallet.rs
index 9743c043..d93cd309 100644
--- a/src/swapd/wallet.rs
+++ b/src/swapd/wallet.rs
@@ -69,9 +69,11 @@ pub struct HandleBuyProcedureSignatureRes {
     pub buy_tx: bitcoin::Transaction,
 }
 
-#[derive(Clone, Debug, StrictEncode, StrictDecode)]
+#[derive(Clone, Display, Debug, StrictEncode, StrictDecode)]
 pub enum Wallet {
+    #[display("Alice's wallet")]
     Alice(AliceState),
+    #[display("Bob's wallet")]
     Bob(BobState),
 }
 
@@ -752,8 +754,9 @@ impl Wallet {
                     }
                 } else {
                     error!(
-                        "{} | Wallet not found or not on correct state",
+                        "{} | Not correct wallet, should be Bob's wallet: {}",
                         swap_id.swap_id(),
+                        self
                     );
                     return Err(Error::Farcaster(
                         "Needs to be a Bob wallet to process Alice Commit".to_string(),
diff --git a/src/syncerd/monero_syncer.rs b/src/syncerd/monero_syncer.rs
index 9f62edde..909dbbf2 100644
--- a/src/syncerd/monero_syncer.rs
+++ b/src/syncerd/monero_syncer.rs
@@ -71,21 +71,24 @@ pub struct Transaction {
     block_hash: Option<Vec<u8>>,
 }
 
-fn create_rpc_client(rpc_url: String, proxy_url: Option<String>) -> monero_rpc::RpcClient {
-    let mut client_builder = monero_rpc::RpcClientBuilder::new();
-    if let Some(proxy_url) = proxy_url {
-        client_builder = client_builder.proxy_address(proxy_url);
-    }
-    client_builder
-        .build(rpc_url)
-        .expect("client builder failed, cannot recover from bad configuration")
-}
-
 impl MoneroRpc {
     fn new(node_rpc_url: String, proxy_url: Option<String>) -> Self {
+        let mut client_builder = monero_rpc::RpcClientBuilder::new();
+        if let Some(proxy_url) = proxy_url {
+            client_builder = client_builder.proxy_address(proxy_url);
+        }
+        let daemon_json_rpc = client_builder
+            .clone()
+            .build(node_rpc_url.clone())
+            .expect("client builder failed, cannot recover from bad configuration")
+            .daemon();
+        let daemon_rpc = client_builder
+            .build(node_rpc_url)
+            .expect("client builder failed, cannot recover from bad configuration")
+            .daemon_rpc();
         MoneroRpc {
-            daemon_json_rpc: create_rpc_client(node_rpc_url.clone(), proxy_url.clone()).daemon(),
-            daemon_rpc: create_rpc_client(node_rpc_url, proxy_url).daemon_rpc(),
+            daemon_json_rpc,
+            daemon_rpc,
             height: 0,
             block_hash: vec![0],
         }
@@ -406,7 +409,6 @@ async fn run_syncerd_task_receiver(
     state: Arc<Mutex<SyncerState>>,
     balance_get_tx: TokioSender<(GetAddressBalance, ServiceId)>,
     tx_event: TokioSender<BridgeEvent>,
-    proxy_address: Option<String>,
 ) {
     tokio::spawn(async move {
         loop {
@@ -491,25 +493,27 @@ async fn run_syncerd_task_receiver(
                         }
                         Task::HealthCheck(HealthCheck { id }) => {
                             debug!("performing health check");
-                            let mut health = match create_rpc_client(
-                                syncer_servers.monero_daemon.clone(),
-                                proxy_address.clone(),
-                            )
-                            .daemon()
-                            .get_block_count()
-                            .await
+                            let mut health = match monero_rpc::RpcClientBuilder::new()
+                                .build(syncer_servers.monero_daemon.clone())
+                                .expect(
+                                    "client builder failed, cannot recover from bad configuration",
+                                )
+                                .daemon()
+                                .get_block_count()
+                                .await
                             {
                                 Ok(_) => Health::Healthy,
                                 Err(err) => Health::FaultyMoneroDaemon(err.to_string()),
                             };
 
-                            health = match create_rpc_client(
-                                syncer_servers.monero_daemon.clone(),
-                                proxy_address.clone(),
-                            )
-                            .wallet()
-                            .get_version()
-                            .await
+                            health = match monero_rpc::RpcClientBuilder::new()
+                                .build(syncer_servers.monero_rpc_wallet.clone())
+                                .expect(
+                                    "client builder failed, cannot recover from bad configuration",
+                                )
+                                .wallet()
+                                .get_version()
+                                .await
                             {
                                 Ok(_) => health,
                                 Err(err) => Health::FaultyMoneroRpcWallet(err.to_string()),
@@ -567,10 +571,9 @@ fn address_polling(
     syncer_servers: MoneroSyncerServers,
     network: monero::Network,
     wallet_mutex: Arc<Mutex<monero_rpc::WalletClient>>,
-    proxy_address: Option<String>,
 ) -> tokio::task::JoinHandle<()> {
     tokio::task::spawn(async move {
-        let mut rpc = MoneroRpc::new(syncer_servers.monero_daemon, proxy_address);
+        let mut rpc = MoneroRpc::new(syncer_servers.monero_daemon, None);
         loop {
             let state_guard = state.lock().await;
             let mut addresses = state_guard.addresses.clone();
@@ -667,10 +670,9 @@ fn address_polling(
 fn height_polling(
     state: Arc<Mutex<SyncerState>>,
     syncer_servers: MoneroSyncerServers,
-    proxy_address: Option<String>,
 ) -> tokio::task::JoinHandle<()> {
     tokio::task::spawn(async move {
-        let mut rpc = MoneroRpc::new(syncer_servers.monero_daemon, proxy_address);
+        let mut rpc = MoneroRpc::new(syncer_servers.monero_daemon, None);
         loop {
             let block_notif = match rpc.check_block().await {
                 Ok(notif) => Some(notif),
@@ -762,10 +764,9 @@ fn sweep_polling(
 fn unseen_transaction_polling(
     state: Arc<Mutex<SyncerState>>,
     syncer_servers: MoneroSyncerServers,
-    proxy_address: Option<String>,
 ) -> tokio::task::JoinHandle<()> {
     tokio::task::spawn(async move {
-        let mut rpc = MoneroRpc::new(syncer_servers.monero_daemon, proxy_address);
+        let mut rpc = MoneroRpc::new(syncer_servers.monero_daemon, None);
         loop {
             let state_guard = state.lock().await;
             let unseen_transactions = state_guard.unseen_transactions.clone();
@@ -985,9 +986,6 @@ impl Synclet for MoneroSyncer {
                 debug!("monero syncer servers: {:?}", syncer_servers);
                 let wallet_dir = opts.monero_wallet_dir_path.clone().map(PathBuf::from);
 
-                let proxy_address = opts.shared.tor_proxy.map(|address| address.to_string());
-                debug!("monero synclet using proxy: {:?}", proxy_address);
-
                 let _handle = std::thread::spawn(move || {
                     use tokio::runtime::Builder;
                     let rt = Builder::new_multi_thread()
@@ -997,11 +995,12 @@ impl Synclet for MoneroSyncer {
                         .unwrap();
                     rt.block_on(async {
                         let wallet_mutex = Arc::new(Mutex::new(
-                            create_rpc_client(
-                                syncer_servers.monero_rpc_wallet.clone(),
-                                proxy_address.clone(),
-                            )
-                            .wallet(),
+                            monero_rpc::RpcClientBuilder::new()
+                                .build(syncer_servers.monero_rpc_wallet.clone())
+                                .expect(
+                                    "client builder failed, cannot recover from bad configuration",
+                                )
+                                .wallet(),
                         ));
                         let (balance_get_tx, balance_get_rx): (
                             TokioSender<(GetAddressBalance, ServiceId)>,
@@ -1023,7 +1022,6 @@ impl Synclet for MoneroSyncer {
                             Arc::clone(&state),
                             balance_get_tx,
                             event_tx.clone(),
-                            proxy_address.clone(),
                         )
                         .await;
                         run_syncerd_bridge_event_sender(tx, event_rx, syncer_address).await;
@@ -1033,21 +1031,14 @@ impl Synclet for MoneroSyncer {
                             syncer_servers.clone(),
                             network,
                             Arc::clone(&wallet_mutex),
-                            proxy_address.clone(),
                         );
 
                         // transaction polling is done in the same loop
-                        let height_handle = height_polling(
-                            Arc::clone(&state),
-                            syncer_servers.clone(),
-                            proxy_address.clone(),
-                        );
+                        let height_handle =
+                            height_polling(Arc::clone(&state), syncer_servers.clone());
 
-                        let unseen_transaction_handle = unseen_transaction_polling(
-                            Arc::clone(&state),
-                            syncer_servers.clone(),
-                            proxy_address.clone(),
-                        );
+                        let unseen_transaction_handle =
+                            unseen_transaction_polling(Arc::clone(&state), syncer_servers.clone());
 
                         let sweep_handle = sweep_polling(
                             Arc::clone(&state),


Test patch:
diff --git a/docs/Testing-with-farcaster.dev.md b/docs/Testing-with-farcaster.dev.md
index f1d85eb9..6999a3cc 100644
--- a/docs/Testing-with-farcaster.dev.md
+++ b/docs/Testing-with-farcaster.dev.md
@@ -1,6 +1,6 @@
-**[Farcaster.dev](https://farcaster.dev) is a website for automating Farcaster deals creation and publication (only testnet trades).**
+**[Farcaster.dev](https://farcaster.dev) is a website for automating Farcaster offers creation and publication (currently only testnet trades).**
 
-In this guide we will go through all the necessary steps to install and setup a node on your machine, choose and take a deal listed there.
+In this guide we will go through all the necessary steps to install and setup a node on your machine, choose and take a public offer listed there.
 
 ## Requirements
 
@@ -24,7 +24,7 @@ In this guide we suggest & assume the following setup:
 
 ### Install Farcaster from sources
 
-You find all the necessary steps to install Farcaster from sources [here](./Install-guide#install-from-sources).
+You find all the necessary steps to install farcaster from sources [here](./Install-guide#install-from-sources).
 
 Now you should be able to run in your shell `farcasterd --help` and `swap-cli --help` and receive answers. If this is not the case, check that the binaries compiled successfully and their location is in your `$PATH` (see `cargo install` documentation).
 
@@ -52,9 +52,9 @@ Use the cli to query `farcasterd`
 swap-cli info
 ```
 
-If you manage to go through all the steps above and you have a running node, congrats! you should now be able to try taking a deal on [farcaster.dev](https://farcaster.dev).
+If you manage to go through all the steps above and you have a running node, congrats! you should now be able to try taking an offer on [farcaster.dev](https://farcaster.dev).
 
-## Taking deal on [farcaster.dev](https://farcaster.dev)
+## Taking offer on [farcaster.dev](https://farcaster.dev)
 
 First steps:
 - Get a destination Bitcoin address
@@ -64,9 +64,9 @@ No matter what type of trade you choose to do, BTC->XMR or XMR->BTC, you need an
 1. a success path address to receive traded funds and
 2. a failure path address in case a refund is initiated
 
-When you have these two addresses go to the website and choose a deal that correspond to the trade you want to take. Then use `swap-cli` to start trading
+When you have these two addresses go to the website and choose an offer that correspond to the trade you want to take. Then use `swap-cli` to start trading
 ```
-swap-cli --btc-addr {...} --xmr-addr {...} -D Deal:...
+swap-cli --btc-addr {...} --xmr-addr {...} -o Offer:...
 ```
 
 You can now follow what's happening on the `farcasterd` logs in your shell and use `swap-cli` to query more details. Use
diff --git a/tests/grpc.rs b/tests/grpc.rs
index 436f3622..1b9d0520 100644
--- a/tests/grpc.rs
+++ b/tests/grpc.rs
@@ -3,9 +3,9 @@ extern crate log;
 
 use crate::farcaster::{
     farcaster_client::FarcasterClient, AbortSwapRequest, CheckpointSelector, CheckpointsRequest,
-    InfoResponse, ListOffersRequest, MakeRequest, NeedsFundingRequest, NetworkSelector,
-    OfferInfoRequest, OfferSelector, PeersRequest, ProgressRequest, RestoreCheckpointRequest,
-    RevokeOfferRequest, SwapInfoRequest, SweepAddressRequest, TakeRequest,
+    InfoResponse, ListOffersRequest, MakeRequest, NeedsFundingRequest, OfferInfoRequest,
+    OfferSelector, PeersRequest, ProgressRequest, RestoreCheckpointRequest, RevokeOfferRequest,
+    SwapInfoRequest, SweepAddressRequest, TakeRequest,
 };
 use bitcoincore_rpc::RpcApi;
 use farcaster::{InfoRequest, MakeResponse, NeedsFundingResponse};
@@ -58,8 +58,7 @@ async fn grpc_server_functional_test() {
     // Test list checkpoints
     let request = tonic::Request::new(CheckpointsRequest {
         id: 2,
-        checkpoint_selector: CheckpointSelector::AllCheckpoints.into(),
-        network_selector: NetworkSelector::AllNetworks.into(),
+        selector: CheckpointSelector::AllCheckpoints.into(),
     });
     let response = farcaster_client_1.checkpoints(request).await;
     assert_eq!(response.unwrap().into_inner().id, 2);
@@ -122,8 +121,7 @@ async fn grpc_server_functional_test() {
     // Test List offers
     let list_offers_request = tonic::Request::new(ListOffersRequest {
         id: 22,
-        offer_selector: OfferSelector::All.into(),
-        network_selector: NetworkSelector::AllNetworks.into(),
+        selector: OfferSelector::All.into(),
     });
     let response = farcaster_client_1.list_offers(list_offers_request).await;
     assert_eq!(response.unwrap().into_inner().id, 22);
@@ -249,7 +247,6 @@ async fn retry_until_bitcoin_funding_info(
         let request = tonic::Request::new(NeedsFundingRequest {
             id: 11,
             blockchain: farcaster::Blockchain::Bitcoin.into(),
-            network_selector: NetworkSelector::LocalNetworks.into(),
         });
         let response = client.needs_funding(request).await;
         let NeedsFundingResponse { funding_infos, .. } = response.unwrap().into_inner();