Skip to content

Commit 5f199f6

Browse files
committed
test token transfer with bigdecimal
1 parent 5f45f1f commit 5f199f6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tests/Unit/Utils/TransactionEncoderTest.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare(strict_types=1);
44

55
use ArkEcosystem\Crypto\Utils\TransactionEncoder;
6+
use ArkEcosystem\Crypto\Utils\UnitConverter;
67

78
it('should encode a multipayment payload', function () {
89
$encoded = TransactionEncoder::multiPayment(
@@ -23,7 +24,7 @@
2324
it('should encode a token transfer payload', function () {
2425
$encoded = TransactionEncoder::tokenTransfer(
2526
'0xA5cc0BfEB09742C5e4C610f2EBaaB82Eb142Ca10',
26-
'1000000000000'
27+
UnitConverter::parseUnits('1000000000000', 'wei')
2728
);
2829

2930
expect($encoded)->toBe(
@@ -33,7 +34,7 @@
3334
});
3435

3536
it('should reject invalid address format in token transfer', function () {
36-
TransactionEncoder::tokenTransfer('', '1000');
37+
TransactionEncoder::tokenTransfer('', UnitConverter::parseUnits('1000', 'wei'));
3738
})->throws(Exception::class);
3839

3940
it('should reject invalid address format in multipayment', function () {

0 commit comments

Comments
 (0)