Skip to content

Commit

Permalink
Uplift of #13554 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-browser-releases committed Jun 14, 2022
1 parent c144448 commit 411a962
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
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 @@ -2821,10 +2821,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 @@ -3059,11 +3063,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 @@ -3085,11 +3090,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 @@ -3116,11 +3122,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

0 comments on commit 411a962

Please sign in to comment.