Rename AssetRatioController to AssetRatioService
This commit is contained in:
+13
-13
@@ -8,7 +8,7 @@ package org.chromium.chrome.browser.crypto_wallet;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
import org.chromium.base.annotations.JNINamespace;
|
||||
import org.chromium.base.annotations.NativeMethods;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.mojo.bindings.ConnectionErrorHandler;
|
||||
import org.chromium.mojo.bindings.Interface;
|
||||
import org.chromium.mojo.bindings.Interface.Proxy.Handler;
|
||||
@@ -17,32 +17,32 @@ import org.chromium.mojo.system.MojoException;
|
||||
import org.chromium.mojo.system.impl.CoreImpl;
|
||||
|
||||
@JNINamespace("chrome::android")
|
||||
public class AssetRatioControllerFactory {
|
||||
public class AssetRatioServiceFactory {
|
||||
private static final Object lock = new Object();
|
||||
private static AssetRatioControllerFactory instance;
|
||||
private static AssetRatioServiceFactory instance;
|
||||
|
||||
public static AssetRatioControllerFactory getInstance() {
|
||||
public static AssetRatioServiceFactory getInstance() {
|
||||
synchronized (lock) {
|
||||
if (instance == null) {
|
||||
instance = new AssetRatioControllerFactory();
|
||||
instance = new AssetRatioServiceFactory();
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private AssetRatioControllerFactory() {}
|
||||
private AssetRatioServiceFactory() {}
|
||||
|
||||
public AssetRatioController getAssetRatioController(
|
||||
public AssetRatioService getAssetRatioService(
|
||||
ConnectionErrorHandler connectionErrorHandler) {
|
||||
int nativeHandle =
|
||||
AssetRatioControllerFactoryJni.get().getInterfaceToAssetRatioController();
|
||||
AssetRatioServiceFactoryJni.get().getInterfaceToAssetRatioService();
|
||||
MessagePipeHandle handle = wrapNativeHandle(nativeHandle);
|
||||
AssetRatioController assetRatioController =
|
||||
AssetRatioController.MANAGER.attachProxy(handle, 0);
|
||||
Handler handler = ((Interface.Proxy) assetRatioController).getProxyHandler();
|
||||
AssetRatioService assetRatioService =
|
||||
AssetRatioService.MANAGER.attachProxy(handle, 0);
|
||||
Handler handler = ((Interface.Proxy) assetRatioService).getProxyHandler();
|
||||
handler.setErrorHandler(connectionErrorHandler);
|
||||
|
||||
return assetRatioController;
|
||||
return assetRatioService;
|
||||
}
|
||||
|
||||
private MessagePipeHandle wrapNativeHandle(int nativeHandle) {
|
||||
@@ -51,6 +51,6 @@ public class AssetRatioControllerFactory {
|
||||
|
||||
@NativeMethods
|
||||
interface Natives {
|
||||
int getInterfaceToAssetRatioController();
|
||||
int getInterfaceToAssetRatioService();
|
||||
}
|
||||
}
|
||||
|
||||
+16
-16
@@ -19,7 +19,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.chromium.brave_wallet.mojom.AccountInfo;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.ErcToken;
|
||||
import org.chromium.brave_wallet.mojom.ErcTokenRegistry;
|
||||
@@ -29,7 +29,7 @@ import org.chromium.brave_wallet.mojom.KeyringController;
|
||||
import org.chromium.brave_wallet.mojom.KeyringInfo;
|
||||
import org.chromium.brave_wallet.mojom.TransactionInfo;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioControllerFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioServiceFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.BraveWalletServiceFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.ERCTokenRegistryFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.EthJsonRpcControllerFactory;
|
||||
@@ -64,14 +64,14 @@ public class AccountDetailActivity extends AsyncInitializationActivity
|
||||
private ErcTokenRegistry mErcTokenRegistry;
|
||||
private EthTxController mEthTxController;
|
||||
private EthJsonRpcController mEthJsonRpcController;
|
||||
private AssetRatioController mAssetRatioController;
|
||||
private AssetRatioService mAssetRatioService;
|
||||
private BraveWalletService mBraveWalletService;
|
||||
private KeyringController mKeyringController;
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mEthJsonRpcController.close();
|
||||
mBraveWalletService.close();
|
||||
mKeyringController.close();
|
||||
@@ -136,7 +136,7 @@ public class AccountDetailActivity extends AsyncInitializationActivity
|
||||
private void setUpAssetList(String chainId) {
|
||||
AccountInfo[] accountInfos = new AccountInfo[] {getThisAccountInfo()};
|
||||
PortfolioHelper portfolioHelper = new PortfolioHelper(getBraveWalletService(),
|
||||
getAssetRatioController(), mEthJsonRpcController, accountInfos);
|
||||
getAssetRatioService(), mEthJsonRpcController, accountInfos);
|
||||
portfolioHelper.setChainId(chainId);
|
||||
portfolioHelper.calculateBalances(() -> {
|
||||
RecyclerView rvAssets = findViewById(R.id.rv_assets);
|
||||
@@ -190,7 +190,7 @@ public class AccountDetailActivity extends AsyncInitializationActivity
|
||||
if (accountInfo.address.equals(mAddress) && accountInfo.name.equals(mName)) {
|
||||
AccountInfo[] accountInfos = new AccountInfo[1];
|
||||
accountInfos[0] = accountInfo;
|
||||
Utils.setUpTransactionList(accountInfos, mAssetRatioController,
|
||||
Utils.setUpTransactionList(accountInfos, mAssetRatioService,
|
||||
mEthTxController, mErcTokenRegistry, mBraveWalletService, null, null, 0,
|
||||
findViewById(R.id.rv_transactions), this, this, chainId);
|
||||
break;
|
||||
@@ -216,7 +216,7 @@ public class AccountDetailActivity extends AsyncInitializationActivity
|
||||
super.finishNativeInitialization();
|
||||
|
||||
InitEthJsonRpcController();
|
||||
InitAssetRatioController();
|
||||
InitAssetRatioService();
|
||||
InitBraveWalletService();
|
||||
InitKeyringController();
|
||||
InitEthTxController();
|
||||
@@ -288,19 +288,19 @@ public class AccountDetailActivity extends AsyncInitializationActivity
|
||||
@Override
|
||||
public void onConnectionError(MojoException e) {
|
||||
mEthJsonRpcController.close();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mBraveWalletService.close();
|
||||
mKeyringController.close();
|
||||
mEthTxController.close();
|
||||
mErcTokenRegistry.close();
|
||||
mEthJsonRpcController = null;
|
||||
mAssetRatioController = null;
|
||||
mAssetRatioService = null;
|
||||
mBraveWalletService = null;
|
||||
mKeyringController = null;
|
||||
mEthTxController = null;
|
||||
mErcTokenRegistry = null;
|
||||
InitEthJsonRpcController();
|
||||
InitAssetRatioController();
|
||||
InitAssetRatioService();
|
||||
InitBraveWalletService();
|
||||
InitKeyringController();
|
||||
InitErcTokenRegistry();
|
||||
@@ -341,13 +341,13 @@ public class AccountDetailActivity extends AsyncInitializationActivity
|
||||
EthJsonRpcControllerFactory.getInstance().getEthJsonRpcController(this);
|
||||
}
|
||||
|
||||
private void InitAssetRatioController() {
|
||||
if (mAssetRatioController != null) {
|
||||
private void InitAssetRatioService() {
|
||||
if (mAssetRatioService != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAssetRatioController =
|
||||
AssetRatioControllerFactory.getInstance().getAssetRatioController(this);
|
||||
mAssetRatioService =
|
||||
AssetRatioServiceFactory.getInstance().getAssetRatioService(this);
|
||||
}
|
||||
|
||||
private void InitBraveWalletService() {
|
||||
@@ -362,8 +362,8 @@ public class AccountDetailActivity extends AsyncInitializationActivity
|
||||
return mEthJsonRpcController;
|
||||
}
|
||||
|
||||
public AssetRatioController getAssetRatioController() {
|
||||
return mAssetRatioController;
|
||||
public AssetRatioService getAssetRatioService() {
|
||||
return mAssetRatioService;
|
||||
}
|
||||
|
||||
public BraveWalletService getBraveWalletService() {
|
||||
|
||||
+20
-20
@@ -26,14 +26,14 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.brave_wallet.mojom.AccountInfo;
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.EthJsonRpcController;
|
||||
import org.chromium.brave_wallet.mojom.EthTxController;
|
||||
import org.chromium.brave_wallet.mojom.KeyringController;
|
||||
import org.chromium.brave_wallet.mojom.KeyringInfo;
|
||||
import org.chromium.brave_wallet.mojom.TransactionInfo;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioControllerFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioServiceFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.ERCTokenRegistryFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.EthJsonRpcControllerFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.EthTxControllerFactory;
|
||||
@@ -60,7 +60,7 @@ import java.util.concurrent.Executors;
|
||||
public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
implements ConnectionErrorHandler, OnWalletListItemClick, KeyringControllerObserver {
|
||||
private SmoothLineChartEquallySpaced chartES;
|
||||
private AssetRatioController mAssetRatioController;
|
||||
private AssetRatioService mAssetRatioService;
|
||||
private KeyringController mKeyringController;
|
||||
private EthTxController mEthTxController;
|
||||
private EthJsonRpcController mEthJsonRpcController;
|
||||
@@ -78,7 +78,7 @@ public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mKeyringController.close();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mEthTxController.close();
|
||||
mEthJsonRpcController.close();
|
||||
}
|
||||
@@ -197,17 +197,17 @@ public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
}
|
||||
|
||||
private void getPriceHistory(String asset, String vsAsset, int timeframe) {
|
||||
if (mAssetRatioController != null) {
|
||||
mAssetRatioController.getPriceHistory(asset, vsAsset, timeframe,
|
||||
if (mAssetRatioService != null) {
|
||||
mAssetRatioService.getPriceHistory(asset, vsAsset, timeframe,
|
||||
(result, priceHistory) -> { chartES.setData(priceHistory); });
|
||||
}
|
||||
}
|
||||
|
||||
private void getPrice(String asset, String vsAsset, int timeframe) {
|
||||
assert mAssetRatioController != null;
|
||||
assert mAssetRatioService != null;
|
||||
String[] fromAssets = new String[] {asset.toLowerCase(Locale.getDefault())};
|
||||
String[] toAssets = new String[] {vsAsset.toLowerCase(Locale.getDefault())};
|
||||
mAssetRatioController.getPrice(fromAssets, toAssets, timeframe, (success, price) -> {
|
||||
mAssetRatioService.getPrice(fromAssets, toAssets, timeframe, (success, price) -> {
|
||||
if (!success && price.length == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -226,13 +226,13 @@ public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
keyringController.getDefaultKeyringInfo(keyringInfo -> {
|
||||
if (keyringInfo != null) {
|
||||
AccountInfo[] accountInfos = keyringInfo.accountInfos;
|
||||
Utils.setUpTransactionList(accountInfos, mAssetRatioController,
|
||||
Utils.setUpTransactionList(accountInfos, mAssetRatioService,
|
||||
mEthTxController, null, null, mAssetSymbol, mContractAddress,
|
||||
mAssetDecimals, findViewById(R.id.rv_transactions), this, this, null);
|
||||
|
||||
SingleTokenBalanceHelper singleTokenBalanceHelper =
|
||||
new SingleTokenBalanceHelper(
|
||||
getAssetRatioController(), getEthJsonRpcController());
|
||||
getAssetRatioService(), getEthJsonRpcController());
|
||||
singleTokenBalanceHelper.getPerAccountBalances(mChainId, mContractAddress,
|
||||
mAssetSymbol, mAssetDecimals, accountInfos, () -> {
|
||||
List<WalletListItemModel> walletListItemModelList =
|
||||
@@ -286,7 +286,7 @@ public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
@Override
|
||||
public void finishNativeInitialization() {
|
||||
super.finishNativeInitialization();
|
||||
InitAssetRatioController();
|
||||
InitAssetRatioService();
|
||||
InitKeyringController();
|
||||
InitEthTxController();
|
||||
InitEthJsonRpcController();
|
||||
@@ -298,12 +298,12 @@ public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
@Override
|
||||
public void onConnectionError(MojoException e) {
|
||||
mKeyringController.close();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mEthTxController.close();
|
||||
mEthJsonRpcController.close();
|
||||
|
||||
mAssetRatioController = null;
|
||||
InitAssetRatioController();
|
||||
mAssetRatioService = null;
|
||||
InitAssetRatioService();
|
||||
|
||||
mKeyringController = null;
|
||||
InitKeyringController();
|
||||
@@ -315,13 +315,13 @@ public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
InitEthJsonRpcController();
|
||||
}
|
||||
|
||||
private void InitAssetRatioController() {
|
||||
if (mAssetRatioController != null) {
|
||||
private void InitAssetRatioService() {
|
||||
if (mAssetRatioService != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAssetRatioController =
|
||||
AssetRatioControllerFactory.getInstance().getAssetRatioController(this);
|
||||
mAssetRatioService =
|
||||
AssetRatioServiceFactory.getInstance().getAssetRatioService(this);
|
||||
}
|
||||
|
||||
private void InitEthTxController() {
|
||||
@@ -375,8 +375,8 @@ public class AssetDetailActivity extends AsyncInitializationActivity
|
||||
return mKeyringController;
|
||||
}
|
||||
|
||||
private AssetRatioController getAssetRatioController() {
|
||||
return mAssetRatioController;
|
||||
private AssetRatioService getAssetRatioService() {
|
||||
return mAssetRatioService;
|
||||
}
|
||||
|
||||
private EthJsonRpcController getEthJsonRpcController() {
|
||||
|
||||
+14
-14
@@ -33,7 +33,7 @@ import com.google.android.material.tabs.TabLayout;
|
||||
import org.chromium.base.ActivityState;
|
||||
import org.chromium.base.ApplicationStatus;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.ErcTokenRegistry;
|
||||
import org.chromium.brave_wallet.mojom.EthJsonRpcController;
|
||||
@@ -42,7 +42,7 @@ import org.chromium.brave_wallet.mojom.KeyringController;
|
||||
import org.chromium.brave_wallet.mojom.TransactionInfo;
|
||||
import org.chromium.brave_wallet.mojom.TransactionStatus;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioControllerFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioServiceFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.BraveWalletServiceFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.ERCTokenRegistryFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.EthJsonRpcControllerFactory;
|
||||
@@ -91,7 +91,7 @@ public class BraveWalletActivity extends AsyncInitializationActivity
|
||||
private ErcTokenRegistry mErcTokenRegistry;
|
||||
private EthJsonRpcController mEthJsonRpcController;
|
||||
private EthTxController mEthTxController;
|
||||
private AssetRatioController mAssetRatioController;
|
||||
private AssetRatioService mAssetRatioService;
|
||||
private BraveWalletService mBraveWalletService;
|
||||
private boolean mShowBiometricPrompt;
|
||||
|
||||
@@ -199,7 +199,7 @@ public class BraveWalletActivity extends AsyncInitializationActivity
|
||||
@Override
|
||||
public void onConnectionError(MojoException e) {
|
||||
mKeyringController.close();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mErcTokenRegistry.close();
|
||||
mEthJsonRpcController.close();
|
||||
mEthTxController.close();
|
||||
@@ -209,13 +209,13 @@ public class BraveWalletActivity extends AsyncInitializationActivity
|
||||
mErcTokenRegistry = null;
|
||||
mEthJsonRpcController = null;
|
||||
mEthTxController = null;
|
||||
mAssetRatioController = null;
|
||||
mAssetRatioService = null;
|
||||
mBraveWalletService = null;
|
||||
InitKeyringController();
|
||||
InitErcTokenRegistry();
|
||||
InitEthJsonRpcController();
|
||||
InitEthTxController();
|
||||
InitAssetRatioController();
|
||||
InitAssetRatioService();
|
||||
InitBraveWalletService();
|
||||
}
|
||||
|
||||
@@ -253,13 +253,13 @@ public class BraveWalletActivity extends AsyncInitializationActivity
|
||||
EthJsonRpcControllerFactory.getInstance().getEthJsonRpcController(this);
|
||||
}
|
||||
|
||||
private void InitAssetRatioController() {
|
||||
if (mAssetRatioController != null) {
|
||||
private void InitAssetRatioService() {
|
||||
if (mAssetRatioService != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAssetRatioController =
|
||||
AssetRatioControllerFactory.getInstance().getAssetRatioController(this);
|
||||
mAssetRatioService =
|
||||
AssetRatioServiceFactory.getInstance().getAssetRatioService(this);
|
||||
}
|
||||
|
||||
private void InitBraveWalletService() {
|
||||
@@ -286,8 +286,8 @@ public class BraveWalletActivity extends AsyncInitializationActivity
|
||||
return mEthTxController;
|
||||
}
|
||||
|
||||
public AssetRatioController getAssetRatioController() {
|
||||
return mAssetRatioController;
|
||||
public AssetRatioService getAssetRatioService() {
|
||||
return mAssetRatioService;
|
||||
}
|
||||
|
||||
public BraveWalletService getBraveWalletService() {
|
||||
@@ -301,7 +301,7 @@ public class BraveWalletActivity extends AsyncInitializationActivity
|
||||
InitErcTokenRegistry();
|
||||
InitEthJsonRpcController();
|
||||
InitEthTxController();
|
||||
InitAssetRatioController();
|
||||
InitAssetRatioService();
|
||||
InitBraveWalletService();
|
||||
if (Utils.shouldShowCryptoOnboarding()) {
|
||||
setNavigationFragments(ONBOARDING_FIRST_PAGE_ACTION);
|
||||
@@ -319,7 +319,7 @@ public class BraveWalletActivity extends AsyncInitializationActivity
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mKeyringController.close();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mErcTokenRegistry.close();
|
||||
mEthJsonRpcController.close();
|
||||
mEthTxController.close();
|
||||
|
||||
+16
-16
@@ -46,7 +46,7 @@ import com.google.android.gms.vision.barcode.BarcodeDetector;
|
||||
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.brave_wallet.mojom.AccountInfo;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletConstants;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.ErcToken;
|
||||
@@ -67,7 +67,7 @@ import org.chromium.brave_wallet.mojom.TransactionStatus;
|
||||
import org.chromium.brave_wallet.mojom.TxData;
|
||||
import org.chromium.brave_wallet.mojom.TxData1559;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioControllerFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.AssetRatioServiceFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.BraveWalletServiceFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.ERCTokenRegistryFactory;
|
||||
import org.chromium.chrome.browser.crypto_wallet.EthJsonRpcControllerFactory;
|
||||
@@ -189,7 +189,7 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
private double mConvertedFromBalance;
|
||||
private double mConvertedToBalance;
|
||||
private EthTxControllerObserverImpl mEthTxControllerObserver;
|
||||
private AssetRatioController mAssetRatioController;
|
||||
private AssetRatioService mAssetRatioService;
|
||||
private ErcToken mCurrentErcToken;
|
||||
private ErcToken mCurrentSwapToErcToken;
|
||||
private SwapController mSwapController;
|
||||
@@ -207,7 +207,7 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
mCameraSourcePreview.release();
|
||||
}
|
||||
mKeyringController.close();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mErcTokenRegistry.close();
|
||||
mEthJsonRpcController.close();
|
||||
mEthTxController.close();
|
||||
@@ -436,8 +436,8 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
}
|
||||
|
||||
private void sendSwapTransaction(TxData data, String from) {
|
||||
assert mAssetRatioController != null;
|
||||
mAssetRatioController.getGasOracle(estimation -> {
|
||||
assert mAssetRatioService != null;
|
||||
mAssetRatioService.getGasOracle(estimation -> {
|
||||
String maxPriorityFeePerGas = "";
|
||||
String maxFeePerGas = "";
|
||||
if (estimation.fastMaxPriorityFeePerGas.equals(estimation.avgMaxPriorityFeePerGas)) {
|
||||
@@ -1477,7 +1477,7 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
@Override
|
||||
public void onConnectionError(MojoException e) {
|
||||
mKeyringController.close();
|
||||
mAssetRatioController.close();
|
||||
mAssetRatioService.close();
|
||||
mErcTokenRegistry.close();
|
||||
mEthJsonRpcController.close();
|
||||
mEthTxController.close();
|
||||
@@ -1488,10 +1488,10 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
mEthJsonRpcController = null;
|
||||
mEthTxController = null;
|
||||
mKeyringController = null;
|
||||
mAssetRatioController = null;
|
||||
mAssetRatioService = null;
|
||||
mSwapController = null;
|
||||
mBraveWalletService = null;
|
||||
InitAssetRatioController();
|
||||
InitAssetRatioService();
|
||||
InitErcTokenRegistry();
|
||||
InitEthJsonRpcController();
|
||||
InitEthTxController();
|
||||
@@ -1500,8 +1500,8 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
InitBraveWalletService();
|
||||
}
|
||||
|
||||
public AssetRatioController getAssetRatioController() {
|
||||
return mAssetRatioController;
|
||||
public AssetRatioService getAssetRatioService() {
|
||||
return mAssetRatioService;
|
||||
}
|
||||
|
||||
public EthTxController getEthTxController() {
|
||||
@@ -1528,13 +1528,13 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
mBraveWalletService = BraveWalletServiceFactory.getInstance().getBraveWalletService(this);
|
||||
}
|
||||
|
||||
private void InitAssetRatioController() {
|
||||
if (mAssetRatioController != null) {
|
||||
private void InitAssetRatioService() {
|
||||
if (mAssetRatioService != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAssetRatioController =
|
||||
AssetRatioControllerFactory.getInstance().getAssetRatioController(this);
|
||||
mAssetRatioService =
|
||||
AssetRatioServiceFactory.getInstance().getAssetRatioService(this);
|
||||
}
|
||||
|
||||
private void InitKeyringController() {
|
||||
@@ -1598,7 +1598,7 @@ public class BuySendSwapActivity extends AsyncInitializationActivity
|
||||
InitEthJsonRpcController();
|
||||
InitEthTxController();
|
||||
InitKeyringController();
|
||||
InitAssetRatioController();
|
||||
InitAssetRatioService();
|
||||
InitSwapController();
|
||||
InitBraveWalletService();
|
||||
|
||||
|
||||
+7
-7
@@ -29,7 +29,7 @@ import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletConstants;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.ErcToken;
|
||||
@@ -82,12 +82,12 @@ public class ApproveTxBottomSheetDialogFragment extends BottomSheetDialogFragmen
|
||||
mApprovedTxObserver = approvedTxObserver;
|
||||
}
|
||||
|
||||
private AssetRatioController getAssetRatioController() {
|
||||
private AssetRatioService getAssetRatioService() {
|
||||
Activity activity = getActivity();
|
||||
if (activity instanceof BuySendSwapActivity) {
|
||||
return ((BuySendSwapActivity) activity).getAssetRatioController();
|
||||
return ((BuySendSwapActivity) activity).getAssetRatioService();
|
||||
} else if (activity instanceof BraveWalletActivity) {
|
||||
return ((BraveWalletActivity) activity).getAssetRatioController();
|
||||
return ((BraveWalletActivity) activity).getAssetRatioService();
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -252,11 +252,11 @@ public class ApproveTxBottomSheetDialogFragment extends BottomSheetDialogFragmen
|
||||
String.format(Locale.getDefault(), "%.4f",
|
||||
Utils.fromHexWei(valueToConvert, decimals)),
|
||||
asset));
|
||||
AssetRatioController assetRatioController = getAssetRatioController();
|
||||
assert assetRatioController != null;
|
||||
AssetRatioService assetRatioService = getAssetRatioService();
|
||||
assert assetRatioService != null;
|
||||
String[] assets = {asset.toLowerCase(Locale.getDefault())};
|
||||
String[] toCurr = {"usd"};
|
||||
assetRatioController.getPrice(
|
||||
assetRatioService.getPrice(
|
||||
assets, toCurr, AssetPriceTimeframe.LIVE, (success, values) -> {
|
||||
String valueFiat = "0";
|
||||
if (values.length != 0) {
|
||||
|
||||
+4
-4
@@ -32,7 +32,7 @@ import org.chromium.base.task.PostTask;
|
||||
import org.chromium.brave_wallet.mojom.AccountInfo;
|
||||
import org.chromium.brave_wallet.mojom.AssetPrice;
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.ErcToken;
|
||||
import org.chromium.brave_wallet.mojom.EthJsonRpcController;
|
||||
@@ -287,10 +287,10 @@ public class PortfolioFragment extends Fragment
|
||||
asset.contractAddress, asset.logo, asset.decimals);
|
||||
}
|
||||
|
||||
private AssetRatioController getAssetRatioController() {
|
||||
private AssetRatioService getAssetRatioService() {
|
||||
Activity activity = getActivity();
|
||||
if (activity instanceof BraveWalletActivity) {
|
||||
return ((BraveWalletActivity) activity).getAssetRatioController();
|
||||
return ((BraveWalletActivity) activity).getAssetRatioService();
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -380,7 +380,7 @@ public class PortfolioFragment extends Fragment
|
||||
|
||||
if (mPortfolioHelper == null) {
|
||||
mPortfolioHelper = new PortfolioHelper(getBraveWalletService(),
|
||||
getAssetRatioController(), getEthJsonRpcController(), accountInfos);
|
||||
getAssetRatioService(), getEthJsonRpcController(), accountInfos);
|
||||
}
|
||||
|
||||
String chainName = mSpinner.getSelectedItem().toString();
|
||||
|
||||
@@ -24,7 +24,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.EthTxController;
|
||||
import org.chromium.brave_wallet.mojom.TransactionInfo;
|
||||
import org.chromium.brave_wallet.mojom.TransactionType;
|
||||
@@ -50,12 +50,12 @@ public class TxFragment extends Fragment {
|
||||
return new TxFragment(txInfo, asset, totalPrice);
|
||||
}
|
||||
|
||||
private AssetRatioController getAssetRatioController() {
|
||||
private AssetRatioService getAssetRatioService() {
|
||||
Activity activity = getActivity();
|
||||
if (activity instanceof BuySendSwapActivity) {
|
||||
return ((BuySendSwapActivity) activity).getAssetRatioController();
|
||||
return ((BuySendSwapActivity) activity).getAssetRatioService();
|
||||
} else if (activity instanceof BraveWalletActivity) {
|
||||
return ((BraveWalletActivity) activity).getAssetRatioController();
|
||||
return ((BraveWalletActivity) activity).getAssetRatioService();
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -127,9 +127,9 @@ public class TxFragment extends Fragment {
|
||||
RadioGroup radioGroup = dialog.findViewById(R.id.max_priority_radio_group);
|
||||
radioGroup.clearCheck();
|
||||
radioGroup.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
AssetRatioController assetRatioController = getAssetRatioController();
|
||||
assert assetRatioController != null;
|
||||
assetRatioController.getGasOracle(estimation -> {
|
||||
AssetRatioService assetRatioService = getAssetRatioService();
|
||||
assert assetRatioService != null;
|
||||
assetRatioService.getGasOracle(estimation -> {
|
||||
mTxInfo.txData.gasEstimation = estimation;
|
||||
mCheckedPriorityId = checkedId;
|
||||
String gasLimit = mTxInfo.txData.baseData.gasLimit;
|
||||
@@ -368,11 +368,11 @@ public class TxFragment extends Fragment {
|
||||
getResources().getString(R.string.crypto_wallet_total_amount),
|
||||
String.format(Locale.getDefault(), "%.8f", Utils.fromHexWei(valueAsset, 18)),
|
||||
mAsset, String.format(Locale.getDefault(), "%.8f", totalGas)));
|
||||
AssetRatioController assetRatioController = getAssetRatioController();
|
||||
if (assetRatioController != null) {
|
||||
AssetRatioService assetRatioService = getAssetRatioService();
|
||||
if (assetRatioService != null) {
|
||||
String[] assets = {"eth"};
|
||||
String[] toCurr = {"usd"};
|
||||
assetRatioController.getPrice(
|
||||
assetRatioService.getPrice(
|
||||
assets, toCurr, AssetPriceTimeframe.LIVE, (success, values) -> {
|
||||
if (!success || values.length == 0) {
|
||||
return;
|
||||
|
||||
@@ -8,7 +8,7 @@ package org.chromium.chrome.browser.crypto_wallet.util;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.brave_wallet.mojom.AssetPrice;
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.AssetTimePrice;
|
||||
import org.chromium.chrome.browser.crypto_wallet.util.AsyncUtils;
|
||||
|
||||
@@ -20,14 +20,14 @@ import java.util.Locale;
|
||||
|
||||
public class AssetsPricesHelper {
|
||||
private static String TAG = "AssetsPricesHelper";
|
||||
private AssetRatioController mAssetRatioController;
|
||||
private AssetRatioService mAssetRatioService;
|
||||
private HashSet<String> mAssets;
|
||||
private HashMap<String, Double> mAssetsPrices;
|
||||
|
||||
public AssetsPricesHelper(AssetRatioController assetRatioController, HashSet<String> assets) {
|
||||
assert assetRatioController != null;
|
||||
public AssetsPricesHelper(AssetRatioService assetRatioService, HashSet<String> assets) {
|
||||
assert assetRatioService != null;
|
||||
assert assets != null;
|
||||
mAssetRatioController = assetRatioController;
|
||||
mAssetRatioService = assetRatioService;
|
||||
mAssets = assets;
|
||||
mAssetsPrices = new HashMap<String, Double>();
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class AssetsPricesHelper {
|
||||
|
||||
pricesContexts.add(priceContext);
|
||||
|
||||
mAssetRatioController.getPrice(
|
||||
mAssetRatioService.getPrice(
|
||||
fromAssets, toAssets, AssetPriceTimeframe.LIVE, priceContext);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ package org.chromium.chrome.browser.crypto_wallet.util;
|
||||
import static org.chromium.chrome.browser.crypto_wallet.util.Utils.warnWhenError;
|
||||
|
||||
import org.chromium.brave_wallet.mojom.AssetPrice;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.AssetTimePrice;
|
||||
import org.chromium.brave_wallet.mojom.ErcToken;
|
||||
import org.chromium.brave_wallet.mojom.EthJsonRpcController;
|
||||
@@ -118,7 +118,7 @@ public class AsyncUtils {
|
||||
}
|
||||
|
||||
public static class GetPriceResponseContext
|
||||
extends SingleResponseBaseContext implements AssetRatioController.GetPriceResponse {
|
||||
extends SingleResponseBaseContext implements AssetRatioService.GetPriceResponse {
|
||||
public Boolean success;
|
||||
public AssetPrice[] prices;
|
||||
|
||||
@@ -153,7 +153,7 @@ public class AsyncUtils {
|
||||
}
|
||||
|
||||
public static class GetPriceHistoryResponseContext extends SingleResponseBaseContext
|
||||
implements AssetRatioController.GetPriceHistoryResponse {
|
||||
implements AssetRatioService.GetPriceHistoryResponse {
|
||||
public Boolean success;
|
||||
public AssetTimePrice[] timePrices;
|
||||
public ErcToken userAsset;
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.chromium.base.Log;
|
||||
import org.chromium.brave_wallet.mojom.AccountInfo;
|
||||
import org.chromium.brave_wallet.mojom.AssetPrice;
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.AssetTimePrice;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.ErcToken;
|
||||
@@ -30,7 +30,7 @@ import java.util.Locale;
|
||||
public class PortfolioHelper {
|
||||
private static String TAG = "PortfolioHelper";
|
||||
private BraveWalletService mBraveWalletService;
|
||||
private AssetRatioController mAssetRatioController;
|
||||
private AssetRatioService mAssetRatioService;
|
||||
private EthJsonRpcController mEthJsonRpcController;
|
||||
private String mChainId;
|
||||
private AccountInfo[] mAccountInfos;
|
||||
@@ -44,13 +44,13 @@ public class PortfolioHelper {
|
||||
private int mFiatHistoryTimeframe;
|
||||
|
||||
public PortfolioHelper(BraveWalletService braveWalletService,
|
||||
AssetRatioController assetRatioController, EthJsonRpcController ethJsonRpcController,
|
||||
AssetRatioService assetRatioService, EthJsonRpcController ethJsonRpcController,
|
||||
AccountInfo[] accountInfos) {
|
||||
assert braveWalletService != null;
|
||||
assert assetRatioController != null;
|
||||
assert assetRatioService != null;
|
||||
assert ethJsonRpcController != null;
|
||||
mBraveWalletService = braveWalletService;
|
||||
mAssetRatioController = assetRatioController;
|
||||
mAssetRatioService = assetRatioService;
|
||||
mEthJsonRpcController = ethJsonRpcController;
|
||||
mAccountInfos = accountInfos;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class PortfolioHelper {
|
||||
|
||||
pricesContexts.add(priceContext);
|
||||
|
||||
mAssetRatioController.getPrice(
|
||||
mAssetRatioService.getPrice(
|
||||
fromAssets, toAssets, AssetPriceTimeframe.LIVE, priceContext);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ public class PortfolioHelper {
|
||||
priceHistoryContext.userAsset = userAsset;
|
||||
pricesHistoryContexts.add(priceHistoryContext);
|
||||
|
||||
mAssetRatioController.getPriceHistory(userAsset.symbol.toLowerCase(Locale.getDefault()),
|
||||
mAssetRatioService.getPriceHistory(userAsset.symbol.toLowerCase(Locale.getDefault()),
|
||||
"usd", mFiatHistoryTimeframe, priceHistoryContext);
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@ import org.chromium.base.Log;
|
||||
import org.chromium.brave_wallet.mojom.AccountInfo;
|
||||
import org.chromium.brave_wallet.mojom.AssetPrice;
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.EthJsonRpcController;
|
||||
import org.chromium.brave_wallet.mojom.ProviderError;
|
||||
|
||||
@@ -21,14 +21,14 @@ import java.util.Locale;
|
||||
|
||||
public class SingleTokenBalanceHelper {
|
||||
private static String TAG = "SingleAccountTokenBalance";
|
||||
private AssetRatioController mAssetRatioController;
|
||||
private AssetRatioService mAssetRatioService;
|
||||
private EthJsonRpcController mEthJsonRpcController;
|
||||
private HashMap<String, Double> mPerAcountFiatBalance;
|
||||
private HashMap<String, Double> mPerAcountCryptoBalance;
|
||||
|
||||
public SingleTokenBalanceHelper(
|
||||
AssetRatioController assetRatioController, EthJsonRpcController ethJsonRpcController) {
|
||||
mAssetRatioController = assetRatioController;
|
||||
AssetRatioService assetRatioService, EthJsonRpcController ethJsonRpcController) {
|
||||
mAssetRatioService = assetRatioService;
|
||||
mEthJsonRpcController = ethJsonRpcController;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SingleTokenBalanceHelper {
|
||||
String[] fromAssets = new String[] {symbol.toLowerCase(Locale.getDefault())};
|
||||
String[] toAssets = new String[] {"usd"};
|
||||
|
||||
mAssetRatioController.getPrice(fromAssets, toAssets, AssetPriceTimeframe.LIVE,
|
||||
mAssetRatioService.getPrice(fromAssets, toAssets, AssetPriceTimeframe.LIVE,
|
||||
(Boolean success, AssetPrice[] prices) -> {
|
||||
// We have to do that to support custom assets
|
||||
String price = "0";
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.chromium.base.Log;
|
||||
import org.chromium.base.Predicate;
|
||||
import org.chromium.brave_wallet.mojom.AccountInfo;
|
||||
import org.chromium.brave_wallet.mojom.AssetPriceTimeframe;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioController;
|
||||
import org.chromium.brave_wallet.mojom.AssetRatioService;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletConstants;
|
||||
import org.chromium.brave_wallet.mojom.BraveWalletService;
|
||||
import org.chromium.brave_wallet.mojom.ErcToken;
|
||||
@@ -911,15 +911,15 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static void setUpTransactionList(AccountInfo[] accountInfos,
|
||||
AssetRatioController assetRatioController, EthTxController ethTxController,
|
||||
AssetRatioService assetRatioService, EthTxController ethTxController,
|
||||
ErcTokenRegistry ercTokenRegistry, BraveWalletService braveWalletService,
|
||||
String assetSymbol, String contractAddress, int assetDecimals,
|
||||
RecyclerView rvTransactions, OnWalletListItemClick callback, Context context,
|
||||
String chainId) {
|
||||
assert assetRatioController != null;
|
||||
assert assetRatioService != null;
|
||||
String[] assets = {"eth"};
|
||||
String[] toCurr = {"usd"};
|
||||
assetRatioController.getPrice(
|
||||
assetRatioService.getPrice(
|
||||
assets, toCurr, AssetPriceTimeframe.LIVE, (success, values) -> {
|
||||
String tempPrice = "0";
|
||||
if (values.length != 0) {
|
||||
@@ -931,7 +931,7 @@ public class Utils {
|
||||
fetchTransactions(accountInfos, Double.valueOf(tempPrice),
|
||||
Double.valueOf(tempPrice), ethTxController, ercTokenRegistry,
|
||||
contractAddress, rvTransactions, callback, context, assetSymbol,
|
||||
assetDecimals, chainId, assetRatioController,
|
||||
assetDecimals, chainId, assetRatioService,
|
||||
braveWalletService);
|
||||
} catch (NumberFormatException exc) {
|
||||
}
|
||||
@@ -941,7 +941,7 @@ public class Utils {
|
||||
final String ethPrice = tempPrice;
|
||||
assets[0] = assetSymbol.toLowerCase(Locale.getDefault());
|
||||
toCurr[0] = "usd";
|
||||
assetRatioController.getPrice(assets, toCurr, AssetPriceTimeframe.LIVE,
|
||||
assetRatioService.getPrice(assets, toCurr, AssetPriceTimeframe.LIVE,
|
||||
(successAsset, valuesAsset) -> {
|
||||
String tempPriceAsset = "0";
|
||||
if (valuesAsset.length != 0) {
|
||||
@@ -952,7 +952,7 @@ public class Utils {
|
||||
Double.valueOf(tempPriceAsset), ethTxController,
|
||||
ercTokenRegistry, contractAddress, rvTransactions,
|
||||
callback, context, assetSymbol, assetDecimals, chainId,
|
||||
assetRatioController, braveWalletService);
|
||||
assetRatioService, braveWalletService);
|
||||
} catch (NumberFormatException exc) {
|
||||
}
|
||||
});
|
||||
@@ -963,7 +963,7 @@ public class Utils {
|
||||
double assetPrice, EthTxController ethTxController, ErcTokenRegistry ercTokenRegistry,
|
||||
String contractAddress, RecyclerView rvTransactions, OnWalletListItemClick callback,
|
||||
Context context, String assetSymbol, int assetDecimals, String chainId,
|
||||
AssetRatioController assetRatioController, BraveWalletService braveWalletService) {
|
||||
AssetRatioService assetRatioService, BraveWalletService braveWalletService) {
|
||||
assert ethTxController != null;
|
||||
PendingTxHelper pendingTxHelper =
|
||||
new PendingTxHelper(ethTxController, accountInfos, true, contractAddress);
|
||||
@@ -975,7 +975,7 @@ public class Utils {
|
||||
} else {
|
||||
fetchAssetsPricesDecimals(accountInfos, ethPrice, assetPrice, ercTokenRegistry,
|
||||
rvTransactions, callback, context, pendingTxInfos, chainId,
|
||||
assetRatioController, braveWalletService);
|
||||
assetRatioService, braveWalletService);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -984,7 +984,7 @@ public class Utils {
|
||||
double assetPrice, ErcTokenRegistry ercTokenRegistry, RecyclerView rvTransactions,
|
||||
OnWalletListItemClick callback, Context context,
|
||||
HashMap<String, TransactionInfo[]> pendingTxInfos, String chainId,
|
||||
AssetRatioController assetRatioController, BraveWalletService braveWalletService) {
|
||||
AssetRatioService assetRatioService, BraveWalletService braveWalletService) {
|
||||
assert chainId != null;
|
||||
assert ercTokenRegistry != null;
|
||||
TokenUtils.getAllTokensFiltered(braveWalletService, ercTokenRegistry, chainId, tokens -> {
|
||||
@@ -1020,7 +1020,7 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
fetchAssetsPrices(accountInfos, ethPrice, assetPrice, rvTransactions, callback, context,
|
||||
pendingTxInfos, assets, assetsDecimals, assetRatioController);
|
||||
pendingTxInfos, assets, assetsDecimals, assetRatioService);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1028,9 +1028,9 @@ public class Utils {
|
||||
double assetPrice, RecyclerView rvTransactions, OnWalletListItemClick callback,
|
||||
Context context, HashMap<String, TransactionInfo[]> pendingTxInfos,
|
||||
HashMap<String, String> assets, HashMap<String, Integer> assetsDecimals,
|
||||
AssetRatioController assetRatioController) {
|
||||
AssetRatioService assetRatioService) {
|
||||
AssetsPricesHelper assetsPricesHelper =
|
||||
new AssetsPricesHelper(assetRatioController, new HashSet<String>(assets.values()));
|
||||
new AssetsPricesHelper(assetRatioService, new HashSet<String>(assets.values()));
|
||||
assetsPricesHelper.fetchPrices(() -> {
|
||||
workWithTransactions(accountInfos, ethPrice, assetPrice, rvTransactions, callback,
|
||||
context, "", 0, pendingTxInfos, assets, assetsDecimals,
|
||||
|
||||
Reference in New Issue
Block a user