-
Notifications
You must be signed in to change notification settings - Fork 7
[525] mempool 주소 가져오는 로직 리팩토링 #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…(block_explorer_screen 수정 과정에서 block_explorer_view_model 생성)
| } | ||
| } | ||
|
|
||
| if (serverName == 'CUSTOM') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이왕 리팩토링하는거 const나 enum으로 정의해서 비교하면 안전할 것 같네요.
|
|
||
| if (serverName.isEmpty) { | ||
| if (NetworkType.currentNetworkType == NetworkType.mainnet) { | ||
| setDefaultElectrumServer(DefaultElectrumServer.coconut); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getter 내부에서 async setter 호출하고 있네요. provider 생성 시 초기화하고, getter에서는 초기화 여부만 확인해서 (ensure 메서드 등으로 분리) getter 역할만 하는게 좋겠습니다.
| } | ||
|
|
||
| Future<void> setCustomExplorerUrl(String url) async { | ||
| var formattedUrl = url.trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block_explorer_view_model.dart에도 중복 코드가 있으니 url normalize 유틸로 빼면 좋을 것 같습니다.
…to refactor/525-mempool
|
transaction_Detail_screen, utxo_Detail_screen.dart 파일에 에러 있음. |
ella-noncelab
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop 브랜치 머지했습니다.
|
|
||
| NetworkPreferenceProvider(); | ||
|
|
||
| Future<void> ensureInitialized() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용하는 곳이 없는 함수
|
😭 아무래도 Electrum 설정 provider와 blockExplorer 설정 provider를 분리해야할 것 같아요. |
issue : #525
block_explorer_service.dart의 getExplorerUrl이 화면 진입 마다 viewmodel에 의해 작동되어 비효율적인 상황
변경 사항
lib/providers/preference_provider.dart에서 네트워크 관련 부분 network_preference_provider.dart로 분리
block_explorer_service.dart 파일 삭제 후 network_preference_provider.dart로 로직 통합.
해당 과정에서 사용되는 변수 및 함수가 있는 연관된 viewmodel, screen 파일도 같이 수정.
특이 사항
preference_provider 추가로 분리하는 리팩토링 필요