rename eth token wallet class

This commit is contained in:
julian 2023-03-03 08:36:56 -06:00
parent f26fb19453
commit 5ba44d5b8e
3 changed files with 5 additions and 7 deletions

View file

@ -64,8 +64,7 @@ class _MyTokenSelectItemState extends ConsumerState<MyTokenSelectItem> {
BorderRadius.circular(Constants.size.circularBorderRadius), BorderRadius.circular(Constants.size.circularBorderRadius),
), ),
onPressed: () async { onPressed: () async {
ref.read(tokenServiceStateProvider.state).state = ref.read(tokenServiceStateProvider.state).state = EthTokenWallet(
EthereumTokenService(
token: widget.token, token: widget.token,
secureStore: ref.read(secureStoreProvider), secureStore: ref.read(secureStoreProvider),
ethWallet: ref ethWallet: ref

View file

@ -19,9 +19,8 @@ import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart'; import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/rounded_container.dart'; import 'package:stackwallet/widgets/rounded_container.dart';
final tokenServiceStateProvider = final tokenServiceStateProvider = StateProvider<EthTokenWallet?>((ref) => null);
StateProvider<EthereumTokenService?>((ref) => null); final tokenServiceProvider = ChangeNotifierProvider<EthTokenWallet?>(
final tokenServiceProvider = ChangeNotifierProvider<EthereumTokenService?>(
(ref) => ref.watch(tokenServiceStateProvider)); (ref) => ref.watch(tokenServiceStateProvider));
/// [eventBus] should only be set during testing /// [eventBus] should only be set during testing

View file

@ -28,7 +28,7 @@ import 'package:stackwallet/utilities/logger.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
import 'package:web3dart/web3dart.dart' as web3dart; import 'package:web3dart/web3dart.dart' as web3dart;
class EthereumTokenService extends ChangeNotifier with EthTokenCache { class EthTokenWallet extends ChangeNotifier with EthTokenCache {
final EthereumWallet ethWallet; final EthereumWallet ethWallet;
final TransactionNotificationTracker tracker; final TransactionNotificationTracker tracker;
final SecureStorageInterface _secureStore; final SecureStorageInterface _secureStore;
@ -42,7 +42,7 @@ class EthereumTokenService extends ChangeNotifier with EthTokenCache {
static const _gasLimit = 200000; static const _gasLimit = 200000;
EthereumTokenService({ EthTokenWallet({
required EthContract token, required EthContract token,
required this.ethWallet, required this.ethWallet,
required SecureStorageInterface secureStore, required SecureStorageInterface secureStore,