Skip to content

Commit

Permalink
style: resolve style guide violations
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsobries authored and actions-user committed Jul 23, 2024
1 parent 3c067d1 commit c063c25
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/Transactions/Deserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,4 @@ private function canReadNonMultiSignature(ByteBuffer $buffer)
$buffer->remaining()
&& ($buffer->remaining() % 64 === 0 || $buffer->remaining() % 65 !== 0);
}

}
10 changes: 4 additions & 6 deletions src/Transactions/Types/MultiPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer;
use ArkEcosystem\Crypto\Utils\Address;
use BitWasp\Bitcoin\Base58;
use BitWasp\Buffertools\Buffer;

/**
* This is the serializer class.
Expand All @@ -38,7 +36,7 @@ public function serialize(array $options = []): ByteBuffer
foreach ($this->data['asset']['payments'] as $payment) {
$buffer->writeUInt64(+$payment['amount']);
$buffer->writeHex(
Address::toBufferHexString($payment['recipientId'])
Address::toBufferHexString($payment['recipientId'])
);
}

Expand All @@ -48,16 +46,16 @@ public function serialize(array $options = []): ByteBuffer
public function deserialize(ByteBuffer $buffer): void
{
$this->data['asset'] = ['payments' => []];

$count = $buffer->readUInt16();

for ($i = 0; $i < $count; $i++) {
$this->data['asset']['payments'][] = [
'amount' => strval($buffer->readUInt64()),
'recipientId' => Address::fromByteBuffer($buffer),
];
}

$this->data['amount'] = strval(array_sum(array_column($this->data['asset']['payments'], 'amount')));
}

Expand Down
1 change: 1 addition & 0 deletions src/Utils/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static function toBufferHexString(string $address): string
}

return $address;

return strtolower($address);
}

Expand Down
1 change: 0 additions & 1 deletion tests/Concerns/Deserialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ protected function assertDeserialized(array $expected, array $keys, int $network
$actual = Deserializer::new($expected['serialized'])->deserialize();
$data = $actual->data;


$this->assertSame($expected['serialized'], Serializer::new($actual)->serialize()->getHex());
$this->assertSameTransactions($expected, $data, $keys);

Expand Down
1 change: 0 additions & 1 deletion tests/Unit/Transactions/Builder/MultiPaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function it_should_match_fixture_passphrase_yyy()
$this->assertSameTransactions($fixture, $builder->transaction->data);
}


/** @test */
public function it_should_match_fixture_vendor_field_passphrase()
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/Transactions/Deserializers/MultiPaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MultiPaymentTest extends TestCase
public function it_should_deserialize_the_transaction_signed_with_a_passphrase_xxxx()
{
$transaction = $this->getTransactionFixture('multi_payment', 'multi-payment-sign');

$this->assertTransaction($transaction);
}

Expand All @@ -50,7 +50,6 @@ private function assertTransaction(array $fixture): MultiPayment
'id',
]);


$this->assertTrue($actual->verify());

return $actual;
Expand Down

0 comments on commit c063c25

Please sign in to comment.