init
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Services\Chain\TronDriver;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Tests\TestCase;
|
||||
|
||||
class TronDriverTest extends TestCase
|
||||
{
|
||||
private const MNEMONIC = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
|
||||
|
||||
#[Test]
|
||||
public function derives_known_tron_address_from_bip44_path(): void
|
||||
{
|
||||
$driver = new TronDriver;
|
||||
|
||||
$this->assertSame(
|
||||
'TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH',
|
||||
$driver->deriveAddress(self::MNEMONIC, 0)
|
||||
);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function validates_tron_base58_addresses(): void
|
||||
{
|
||||
$driver = new TronDriver;
|
||||
|
||||
$this->assertTrue($driver->isValidAddress('TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH'));
|
||||
$this->assertFalse($driver->isValidAddress('0xab5c66752a9e8167967685f1450532fb96d5d24f'));
|
||||
$this->assertFalse($driver->isValidAddress('Tinvalid'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user