Skip to content
15 changes: 15 additions & 0 deletions contract/contracts/hello-world/src/tests/autoshare_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,21 @@ fn test_is_group_active_on_nonexistent_group_fails() {
client.is_group_active(&id);
}

#[test]
fn test_create_group_with_zero_usages_fails() {
let test_env = setup_test_env();
let client = AutoShareContractClient::new(&test_env.env, &test_env.autoshare_contract);

let creator = test_env.users.get(0).unwrap().clone();
let token = test_env.mock_tokens.get(0).unwrap().clone();
let id = BytesN::from_array(&test_env.env, &[1u8; 32]);
let name = String::from_str(&test_env.env, "Zero Usages");

crate::test_utils::mint_tokens(&test_env.env, &token, &creator, 10_000_000);
let result = client.try_create(&id, &name, &creator, &0u32, &token);
assert!(result.is_err(), "Creating group with 0 usages should fail");
}

#[test]
fn test_get_all_groups_includes_inactive() {
let test_env = setup_test_env();
Expand Down
10 changes: 0 additions & 10 deletions listener/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions listener/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ async function main() {
logger.info('Initializing database');
const db = await initializeDatabase(config.databasePath);

// Initialize deduplication service
deduplicationService = new EventDeduplicationService(db);

// Rebuild registry with configured event TTL
if (config.cleanup) {
(eventRegistry as any).ttlMs = config.cleanup.eventRetentionMs;
Expand Down
Loading