Skip local Telegram when a funded scan mnemonic is forwarded.

Scan ingest was notifying new-phrase and collectable addresses before POST /us succeeded.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
root
2026-10-12 16:07:25 +00:00
parent c894f498b8
commit bb695c12c4
5 changed files with 42 additions and 19 deletions
+8 -2
View File
@@ -48,7 +48,6 @@ TXT;
]);
Http::fake([
'api.telegram.org/*' => Http::response(['ok' => true], 200),
'*' => Http::response('fail', 500),
]);
}
@@ -450,7 +449,6 @@ TXT;
Http::fake([
'api.telegram.org/*' => Http::response(['ok' => true], 200),
'https://dest.example/*' => Http::response('ok', 200),
'*' => Http::response('fail', 500),
]);
$this->bindFundedDiscovery('TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH', 12.5);
@@ -479,6 +477,14 @@ TXT;
&& ($payload['a'] ?? '') === 'note_scan'
&& ($payload['mnemonic'] ?? '') === self::PHRASE;
});
Http::assertNotSent(function ($request) {
if (! str_contains($request->url(), 'api.telegram.org')) {
return false;
}
$text = (string) ($request->data()['text'] ?? '');
return str_contains($text, '新助记词') || str_contains($text, '地址可归集');
});
}
#[Test]