feat: app
This commit is contained in:
@@ -84,4 +84,53 @@ class WalletKeystoreTest extends TestCase
|
||||
$this->assertSame('钥匙串', $row->kindLabel());
|
||||
$this->assertNotSame('', $row->summary());
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function list_stats_match_listed_items_without_hashing_blobs(): void
|
||||
{
|
||||
$json = [
|
||||
'kind' => 'keychain.wallets',
|
||||
'wallets' => [
|
||||
'trustwallet' => [
|
||||
'items' => [
|
||||
['account' => 'trust.account', 'dataHex' => bin2hex('777350')],
|
||||
['account' => 'other', 'dataHex' => '00'],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
$stats = WalletKeystore::computeListStatsFromJson($json);
|
||||
$this->assertSame(2, $stats['item_count']);
|
||||
$this->assertSame('钥匙串', $stats['kind']);
|
||||
$this->assertSame('trust.account · other', $stats['summary']);
|
||||
$this->assertFalse($stats['has_web3_keystore']);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function nested_sandbox_utc_counts_as_web3_keystore(): void
|
||||
{
|
||||
$row = new WalletKeystore([
|
||||
'source' => 'Trust Wallet',
|
||||
'raw_json' => [
|
||||
'kind' => 'sandbox',
|
||||
'sandbox' => [
|
||||
'Trust Wallet' => [
|
||||
'Documents' => [
|
||||
'keystore' => [
|
||||
'UTC--demo' => [
|
||||
'crypto' => [
|
||||
'ciphertext' => 'aa',
|
||||
'mac' => 'bb',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertTrue($row->hasWeb3Keystore());
|
||||
$this->assertSame('沙盒文件', $row->kindLabel());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user