File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 77use Bavix \Wallet \Exceptions \AmountInvalid ;
88use Bavix \Wallet \Exceptions \BalanceIsEmpty ;
99use Bavix \Wallet \Internal \Exceptions \ExceptionInterface ;
10+ use Bavix \Wallet \Internal \Service \DatabaseServiceInterface ;
1011use Bavix \Wallet \Internal \Service \MathServiceInterface ;
1112use Bavix \Wallet \Models \Transaction ;
1213use Bavix \Wallet \Test \Infra \Factories \UserFloatFactory ;
@@ -284,9 +285,12 @@ public function testBitcoin(): void
284285
285286 $ math = app (MathServiceInterface::class);
286287
287- for ($ i = 0 ; $ i < 256 ; ++$ i ) {
288- $ user ->depositFloat ('0.00000001 ' ); // Satoshi
289- }
288+ // optimize
289+ app (DatabaseServiceInterface::class)->transaction (function () use ($ user ) {
290+ for ($ i = 0 ; $ i < 256 ; ++$ i ) {
291+ $ user ->depositFloat ('0.00000001 ' ); // Satoshi
292+ }
293+ });
290294
291295 self ::assertSame ($ user ->balance , '256 ' .str_repeat ('0 ' , 32 - 8 ));
292296 self ::assertSame (0 , $ math ->compare ($ user ->balanceFloat , '0.00000256 ' ));
You can’t perform that action at this time.
0 commit comments