<?php
use App\Domain\Blockchain\Data\AddressRequest; use App\Infrastructure\Providers\SelfHostedTronGateway; use Illuminate\Support\Facades\Http;
it('creates a dedicated address through the isolated signer service',function(){config()->set('gateway.tron.signer_url','https://signer.internal');config()->set('gateway.tron.signer_token','token');Http::fake(['signer.internal/v1/addresses'=>Http::response(['address'=>'TTestAddress','reference'=>'addr_1'],201)]);$a=app(SelfHostedTronGateway::class)->createDepositAddress(new AddressRequest('tron','sandbox','pay_1'));expect($a->address)->toBe('TTestAddress')->and($a->providerReference)->toBe('addr_1');Http::assertSent(fn($r)=>$r->hasHeader('Authorization','Bearer token'));});
