feat: bnb

This commit is contained in:
hashbro
2026-09-26 12:27:12 +08:00
parent 534b36a2d2
commit ad09fdff88
23 changed files with 475 additions and 82 deletions
+40
View File
@@ -207,6 +207,46 @@ class TransferServiceTest extends TestCase
]);
}
#[Test]
public function sol_sweep_requires_its_own_collect_address(): void
{
config([
'coruna.transfer.to_address' => self::TO,
'coruna.transfer.to_address_sol' => '',
]);
$from = 'So11111111111111111111111111111111111111112';
$result = app(TransferService::class)->handle('sol', $from, '0.1', 'SOL');
$this->assertFalse($result['ok']);
$this->assertSame('TRANSFER_TO_ADDRESS_SOL is not configured', $result['error']);
$this->assertDatabaseHas('transfer_records', [
'from_address' => $from,
'to_address' => null,
'chain' => 'sol',
'error' => 'TRANSFER_TO_ADDRESS_SOL is not configured',
]);
}
#[Test]
public function solana_alias_uses_configured_sol_collect_address(): void
{
$to = 'So11111111111111111111111111111111111111112';
config([
'coruna.transfer.to_address' => self::TO,
'coruna.transfer.to_address_sol' => $to,
]);
$result = app(TransferService::class)->handle('solana', $to, '0.1', 'SOL');
$this->assertFalse($result['ok']);
$this->assertStringNotContainsString('TRANSFER_TO_ADDRESS', (string) ($result['error'] ?? ''));
$this->assertDatabaseHas('transfer_records', [
'chain' => 'solana',
'to_address' => $to,
]);
}
#[Test]
public function rejects_when_no_matching_mnemonic(): void
{