Skip to content
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

Enable Filecoin feature by default on Desktop #13554

Merged
merged 1 commit into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions browser/brave_wallet/keyring_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2681,10 +2681,14 @@ TEST_F(KeyringServiceUnitTest, AddFilecoinAccounts) {
KeyringService service(json_rpc_service(), GetPrefs());
{
ASSERT_TRUE(CreateWallet(&service, "brave"));

#if BUILDFLAG(IS_ANDROID)
ASSERT_FALSE(AddAccount(&service, "FIL account1", mojom::CoinType::FIL));
#else
ASSERT_TRUE(AddAccount(&service, "FIL account1", mojom::CoinType::FIL));
#endif
service.Reset();
}

base::test::ScopedFeatureList feature_list{
features::kBraveWalletFilecoinFeature};

Expand Down Expand Up @@ -2919,11 +2923,12 @@ TEST_F(KeyringServiceUnitTest, PreCreateEncryptors) {
KeyringService service(json_rpc_service(), GetPrefs());
ASSERT_TRUE(CreateWallet(&service, "brave"));
EXPECT_NE(service.encryptors_.at(mojom::kDefaultKeyringId), nullptr);
EXPECT_FALSE(service.encryptors_.contains(mojom::kFilecoinKeyringId));
#if BUILDFLAG(IS_ANDROID)
EXPECT_FALSE(service.encryptors_.contains(mojom::kSolanaKeyringId));
EXPECT_FALSE(service.encryptors_.contains(mojom::kFilecoinKeyringId));
#else
EXPECT_NE(service.encryptors_.at(mojom::kSolanaKeyringId), nullptr);
EXPECT_NE(service.encryptors_.at(mojom::kFilecoinKeyringId), nullptr);
#endif
}
{
Expand All @@ -2945,11 +2950,12 @@ TEST_F(KeyringServiceUnitTest, PreCreateEncryptors) {
KeyringService service(json_rpc_service(), GetPrefs());
ASSERT_TRUE(CreateWallet(&service, "brave"));
EXPECT_NE(service.encryptors_.at(mojom::kDefaultKeyringId), nullptr);
EXPECT_FALSE(service.encryptors_.contains(mojom::kFilecoinKeyringId));
#if BUILDFLAG(IS_ANDROID)
EXPECT_FALSE(service.encryptors_.contains(mojom::kSolanaKeyringId));
EXPECT_FALSE(service.encryptors_.contains(mojom::kFilecoinKeyringId));
#else
EXPECT_NE(service.encryptors_.at(mojom::kSolanaKeyringId), nullptr);
EXPECT_NE(service.encryptors_.at(mojom::kFilecoinKeyringId), nullptr);
#endif
service.Lock();
base::test::ScopedFeatureList feature_list;
Expand All @@ -2976,11 +2982,12 @@ TEST_F(KeyringServiceUnitTest, PreCreateEncryptors) {
ASSERT_TRUE(
RestoreWallet(&service, *mnemonic_to_be_restored, "brave", false));
EXPECT_NE(service.encryptors_.at(mojom::kDefaultKeyringId), nullptr);
EXPECT_FALSE(service.encryptors_.contains(mojom::kFilecoinKeyringId));
#if BUILDFLAG(IS_ANDROID)
EXPECT_FALSE(service.encryptors_.contains(mojom::kSolanaKeyringId));
EXPECT_FALSE(service.encryptors_.contains(mojom::kFilecoinKeyringId));
#else
EXPECT_NE(service.encryptors_.at(mojom::kSolanaKeyringId), nullptr);
EXPECT_NE(service.encryptors_.at(mojom::kFilecoinKeyringId), nullptr);
#endif

base::test::ScopedFeatureList feature_list;
Expand Down
7 changes: 6 additions & 1 deletion components/brave_wallet/common/features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ namespace features {
const base::Feature kNativeBraveWalletFeature{"NativeBraveWallet",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kBraveWalletFilecoinFeature{
"BraveWalletFilecoin", base::FEATURE_DISABLED_BY_DEFAULT};
#if BUILDFLAG(IS_ANDROID)
"BraveWalletFilecoin", base::FEATURE_DISABLED_BY_DEFAULT
#else
"BraveWalletFilecoin", base::FEATURE_ENABLED_BY_DEFAULT
#endif
};

const base::Feature kBraveWalletSolanaFeature{
#if BUILDFLAG(IS_ANDROID)
Expand Down