Skip to content

Commit 2087b50

Browse files
committed
test: update TAP validation checks for dual domain support
Update receipt validation checks and test infrastructure to support dual domain separators. Ensures proper EIP712 domain usage for both V1 and V2 receipt types in testing scenarios.
1 parent 9f8d951 commit 2087b50

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

crates/service/src/tap/checks/receipt_max_val_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ mod tests {
6666
.unwrap();
6767

6868
let eip712_domain_separator: Eip712Domain =
69-
tap_eip712_domain(1, Address::from([0x11u8; 20]));
69+
tap_eip712_domain(1, Address::from([0x11u8; 20]), tap_core::TapVersion::V1);
7070

7171
let timestamp = SystemTime::now()
7272
.duration_since(SystemTime::UNIX_EPOCH)

crates/service/src/tap/checks/timestamp_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ mod tests {
7575
.build()
7676
.unwrap();
7777
let eip712_domain_separator: Eip712Domain =
78-
tap_eip712_domain(1, Address::from([0x11u8; 20]));
78+
tap_eip712_domain(1, Address::from([0x11u8; 20]), tap_core::TapVersion::V1);
7979
let value: u128 = 1234;
8080
let nonce: u64 = 10;
8181
let receipt = Eip712SignedMessage::new(

crates/tap-agent/src/test.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ use crate::{
5656
pub static SENDER_2: LazyLock<(PrivateKeySigner, Address)> = LazyLock::new(|| wallet(1));
5757
pub static INDEXER: LazyLock<(PrivateKeySigner, Address)> = LazyLock::new(|| wallet(3));
5858
pub static TAP_EIP712_DOMAIN_SEPARATOR: LazyLock<Eip712Domain> =
59-
LazyLock::new(|| tap_eip712_domain(1, Address::from([0x11u8; 20])));
59+
LazyLock::new(|| tap_eip712_domain(1, Address::from([0x11u8; 20]), tap_core::TapVersion::V1));
60+
pub static TAP_EIP712_DOMAIN_SEPARATOR_V2: LazyLock<Eip712Domain> =
61+
LazyLock::new(|| tap_eip712_domain(1, Address::from([0x11u8; 20]), tap_core::TapVersion::V2));
6062

6163
pub const TRIGGER_VALUE: u128 = 500;
6264
pub const RECEIPT_LIMIT: u64 = 10000;
@@ -173,6 +175,7 @@ pub async fn create_sender_account(
173175
escrow_subgraph,
174176
network_subgraph,
175177
domain_separator: TAP_EIP712_DOMAIN_SEPARATOR.clone(),
178+
domain_separator_v2: TAP_EIP712_DOMAIN_SEPARATOR_V2.clone(),
176179
sender_aggregator_endpoint: aggregator_url,
177180
allocation_ids: HashSet::new(),
178181
prefix: Some(prefix.clone()),
@@ -241,6 +244,7 @@ pub async fn create_sender_accounts_manager(
241244
let args = SenderAccountsManagerArgs {
242245
config,
243246
domain_separator: TAP_EIP712_DOMAIN_SEPARATOR.clone(),
247+
domain_separator_v2: TAP_EIP712_DOMAIN_SEPARATOR_V2.clone(),
244248
pgpool,
245249
indexer_allocations: allocations_rx,
246250
escrow_accounts_v1: escrow_accounts_rx,

0 commit comments

Comments
 (0)