Skip to content

Commit

Permalink
chore: remove deprecated code (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsobries authored Dec 5, 2024
1 parent d5f4836 commit 2ab229c
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions tests/Concerns/Deserialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,53 +37,6 @@ protected function assertSameTransactions(array $expected, array $actual, array
ksort($expected);
ksort($actual);

if (isset($actual['asset']['multiSignature'])) {
ksort($expected['asset']['multiSignature']);
ksort($actual['asset']['multiSignature']);
} elseif (isset($actual['asset']['multiSignatureLegacy'])) {
ksort($expected['asset']['multiSignatureLegacy']);
ksort($actual['asset']['multiSignatureLegacy']);
}

if (isset($actual['asset']['payments'])) {
for ($i = 0; $i < count($actual['asset']['payments']); $i++) {
ksort($actual['asset']['payments'][$i]);
}
}

$this->assertSame($expected, $actual);
}

protected function assertSameSerialization(string $expected, string $actual): void
{
// Signatures is not deterministic so we need to remove them from the comparison
$this->assertSame(substr($expected, 0, -128), substr($actual, 0, -128));
}

protected function assertSameSerializationMultisignature(string $expected, string $actual, int $numberOfParticipants): void
{
$signaturesPartLength = 128 + ($numberOfParticipants * 130);

// Signatures is not deterministic so we need to remove them from the comparison
$this->assertSame(substr($expected, 0, -$signaturesPartLength), substr($actual, 0, -$signaturesPartLength));
}

protected function assertSignaturesAreSerialized(string $serialized, array $signatures): void
{
foreach ($signatures as $signature) {
$this->assertStringContainsString($signature, $serialized);
}
}

private function array_only(array $arr, array $keys): array
{
$returnArray = [];
foreach ($keys as $key) {
if (isset($arr[$key])) {
$returnArray[$key] = $arr[$key];
}
}

return $returnArray;
}
}

0 comments on commit 2ab229c

Please sign in to comment.