fix: test
This commit is contained in:
@@ -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"}'],
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user