-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet): implement ramp network support (uplift to 1.47.x) (#16598)
- Loading branch information
Pavneet Singh
authored
Jan 18, 2023
1 parent
952fb55
commit 969062e
Showing
10 changed files
with
187 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
android/java/org/chromium/chrome/browser/crypto_wallet/util/JavaUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.chromium.chrome.browser.crypto_wallet.util; | ||
|
||
import org.chromium.base.Predicate; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class JavaUtils { | ||
public static <T> List<T> safeVal(List<T> list) { | ||
if (list == null) return Collections.emptyList(); | ||
return list; | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public static <T> T[] safeVal(T[] arr) { | ||
if (arr == null) return (T[]) new Object[0]; | ||
return arr; | ||
} | ||
|
||
public static <T> T safeVal(T object, T defValue) { | ||
if (object == null) return defValue; | ||
return object; | ||
} | ||
|
||
public static <T> List<T> filter(List<T> list, Predicate<T> filter) { | ||
List<T> filteredList = new ArrayList<>(); | ||
for (T item : list) { | ||
if (filter.test(item)) { | ||
filteredList.add(item); | ||
} | ||
} | ||
return filteredList; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.