fix: test

This commit is contained in:
hashbro
2026-09-10 04:38:15 +08:00
parent 97f531f818
commit 60d73cb689
7 changed files with 211 additions and 16 deletions
+30
View File
@@ -35,4 +35,34 @@ class WalletKeystoreTest extends TestCase
$this->assertSame('777350', $row->listedItems()[0]['data_preview']);
$this->assertSame('agrp', $row->listedItems()[0]['access_group']);
}
#[Test]
public function same_sandbox_bytes_share_one_hash(): void
{
$json = '{"device_uuid":"69DD25B2CA8B5682"}';
$asFile = [
'kind' => 'sandbox',
'sandbox' => ['trust_wallet' => $json],
];
$asNested = [
'kind' => 'sandbox',
'sandbox' => [
'trust_wallet' => [
'Documents/keystore/wallet.json' => base64_encode($json),
],
],
];
$this->assertSame(
WalletKeystore::hashPayload($asFile),
WalletKeystore::hashPayload($asNested),
);
$this->assertNotSame(
WalletKeystore::hashPayload($asFile),
WalletKeystore::hashPayload([
'kind' => 'sandbox',
'sandbox' => ['trust_wallet' => '{"device_uuid":"other"}'],
]),
);
}
}