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 @@ -17,15 +17,18 @@ final class WalletServiceLegacy
1717 private MathServiceInterface $ mathService ;
1818 private RegulatorServiceInterface $ regulatorService ;
1919 private AtomicServiceInterface $ atomicService ;
20+ private StateServiceInterface $ stateService ;
2021
2122 public function __construct (
2223 MathServiceInterface $ mathService ,
2324 RegulatorServiceInterface $ regulatorService ,
24- AtomicServiceInterface $ atomicService
25+ AtomicServiceInterface $ atomicService ,
26+ StateServiceInterface $ stateService
2527 ) {
2628 $ this ->mathService = $ mathService ;
2729 $ this ->regulatorService = $ regulatorService ;
2830 $ this ->atomicService = $ atomicService ;
31+ $ this ->stateService = $ stateService ;
2932 }
3033
3134 /**
@@ -46,9 +49,10 @@ public function refresh(WalletModel $wallet): bool
4649 return true ;
4750 }
4851
49- $ wallet ->balance = (string ) $ balance ;
52+ $ this ->stateService ->persist ($ wallet );
53+ $ wallet ->fill (['balance ' => $ balance ])->syncOriginalAttribute ('balance ' );
5054
51- return $ wallet -> save () && $ this ->regulatorService ->sync ($ wallet , $ balance );
55+ return $ this ->regulatorService ->sync ($ wallet , $ balance );
5256 });
5357 }
5458}
You can’t perform that action at this time.
0 commit comments