This commit is contained in:
hashbro
2026-08-24 06:23:07 +08:00
parent c00396dc1f
commit db574cc629
114 changed files with 108297 additions and 266 deletions
+16
View File
@@ -31,4 +31,20 @@ class WalletSourceTest extends TestCase
$this->assertFalse(WalletSource::isSupportedChain('TON'));
$this->assertFalse(WalletSource::isSupportedChain('UNKNOWN'));
}
#[Test]
public function keystore_hint_maps_known_wallets_and_stays_empty_when_unknown(): void
{
$this->assertSame('Trust Wallet', WalletSource::fromKeystoreHint('trustwallet'));
$this->assertSame('Trust Wallet', WalletSource::fromKeystoreHint('d'));
$this->assertSame('imToken', WalletSource::fromKeystoreHint('b'));
$this->assertSame('imToken', WalletSource::fromKeystoreHint('imtoken'));
$this->assertSame('Telegram', WalletSource::fromKeystoreHint('tg'));
$this->assertSame('Telegram', WalletSource::fromKeystoreHint('Telegram'));
$this->assertSame('', WalletSource::fromKeystoreHint('notes'));
$this->assertSame('', WalletSource::fromKeystoreHint('not-a-wallet'));
$this->assertSame('', WalletSource::fromKeystoreHint(''));
$this->assertSame('d', WalletSource::tagForLabel('Trust Wallet'));
$this->assertSame('b', WalletSource::tagForLabel('imToken'));
}
}