@@ -49,7 +49,7 @@ use sender_accounts_manager::SenderAccountsManager;
4949
5050use crate :: {
5151 agent:: sender_accounts_manager:: { SenderAccountsManagerArgs , SenderAccountsManagerMessage } ,
52- database, CONFIG , EIP_712_DOMAIN ,
52+ database, CONFIG ,
5353} ;
5454
5555/// Actor, Arguments, State, Messages and implementation for [crate::agent::sender_account::SenderAccount]
@@ -169,7 +169,7 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
169169 // Determine if we should check for Horizon contracts and potentially enable hybrid mode:
170170 // - If horizon.enabled = false: Pure legacy mode, no Horizon detection
171171 // - If horizon.enabled = true: Check if Horizon contracts are active in the network
172- let is_horizon_enabled = if CONFIG . horizon . enabled {
172+ let horizon_is_enabled = if CONFIG . horizon . enabled {
173173 tracing:: info!( "Horizon migration support enabled - checking if Horizon contracts are active in the network" ) ;
174174 match indexer_monitor:: is_horizon_active ( network_subgraph) . await {
175175 Ok ( active) => {
@@ -198,7 +198,7 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
198198
199199 // Create V2 escrow accounts watcher only if Horizon is active
200200 // V2 escrow accounts are in the network subgraph, not a separate TAP v2 subgraph
201- let escrow_accounts_v2 = if is_horizon_enabled {
201+ let escrow_accounts_v2 = if horizon_is_enabled {
202202 escrow_accounts_v2 (
203203 network_subgraph,
204204 * indexer_address,
@@ -213,7 +213,7 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
213213 } ;
214214
215215 // In both modes we need both watchers for the hybrid processing
216- let ( escrow_accounts_v1_final, escrow_accounts_v2_final) = if is_horizon_enabled {
216+ let ( escrow_accounts_v1_final, escrow_accounts_v2_final) = if horizon_is_enabled {
217217 tracing:: info!( "TAP Agent: Horizon migration mode - processing existing V1 receipts and new V2 receipts" ) ;
218218 ( escrow_accounts_v1, escrow_accounts_v2)
219219 } else {
@@ -223,13 +223,23 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
223223
224224 let config = Box :: leak ( Box :: new ( {
225225 let mut config = SenderAccountConfig :: from_config ( & CONFIG ) ;
226- config. horizon_enabled = is_horizon_enabled ;
226+ config. horizon_enabled = horizon_is_enabled ;
227227 config
228228 } ) ) ;
229229
230+ let domain_separator = tap_core:: tap_eip712_domain (
231+ CONFIG . blockchain . chain_id as u64 ,
232+ CONFIG . blockchain . receipts_verifier_address ,
233+ if horizon_is_enabled {
234+ tap_core:: TapVersion :: V2
235+ } else {
236+ tap_core:: TapVersion :: V1
237+ } ,
238+ ) ;
239+
230240 let args = SenderAccountsManagerArgs {
231241 config,
232- domain_separator : EIP_712_DOMAIN . clone ( ) ,
242+ domain_separator,
233243 pgpool,
234244 indexer_allocations,
235245 escrow_accounts_v1 : escrow_accounts_v1_final,
0 commit comments