From 67a9fe3d554963e31e27bd1dde8b84f0204e120d Mon Sep 17 00:00:00 2001 From: brave-builds Date: Tue, 18 May 2021 15:02:23 +0000 Subject: [PATCH] Uplift of #8826 (squashed) to beta --- .../browser/rewards_protocol_handler.cc | 2 +- .../ledger/internal/bitflyer/bitflyer_util.h | 2 +- .../bitflyer/bitflyer_util_unittest.cc | 27 ++++++++++--------- .../endpoint/bitflyer/bitflyer_utils.cc | 2 +- .../bitflyer/bitflyer_utils_unittest.cc | 2 +- .../get_balance/get_balance_bitflyer.h | 2 +- .../bitflyer/post_oauth/post_oauth_bitflyer.h | 2 +- .../post_transaction_bitflyer.h | 2 +- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/components/brave_rewards/browser/rewards_protocol_handler.cc b/components/brave_rewards/browser/rewards_protocol_handler.cc index c3fd72851efd..cc77ecda405b 100644 --- a/components/brave_rewards/browser/rewards_protocol_handler.cc +++ b/components/brave_rewards/browser/rewards_protocol_handler.cc @@ -61,7 +61,7 @@ void LoadRewardsURL( // Only accept rewards scheme from allowed domains const std::string bitflyer_staging_host = GURL(BITFLYER_STAGING_URL).host(); const char* kAllowedDomains[] = { - "bitflyer.jp", // bitFlyer production + "bitflyer.com", // bitFlyer production bitflyer_staging_host.c_str(), // bitFlyer staging "uphold.com", // Uphold staging/production }; diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util.h b/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util.h index 4290945b895a..5f72cae84e06 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util.h +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util.h @@ -18,7 +18,7 @@ class LedgerImpl; namespace bitflyer { const char kUrlStaging[] = BITFLYER_STAGING_URL; -const char kUrlProduction[] = "https://bitflyer.jp"; +const char kUrlProduction[] = "https://bitflyer.com"; const char kFeeAddressStaging[] = "068e675b-f137-48ed-8068-4ad34ca4f30f"; const char kFeeAddressProduction[] = "e77cacb4-c49c-4451-bc2d-5072c10e55d3"; const char kACAddressStaging[] = ""; diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util_unittest.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util_unittest.cc index 17f2eba1e7dc..2d6fa15082f9 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util_unittest.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/bitflyer/bitflyer_util_unittest.cc @@ -83,14 +83,15 @@ TEST_F(BitflyerUtilTest, GetAuthorizeUrl) { std::string result = bitflyer::GetAuthorizeUrl("my-state", "my-code-verifier"); ASSERT_EQ(result, - "https://bitflyer.jp/ex/OAuth/authorize" - "?client_id=" BITFLYER_CLIENT_ID - "&scope=assets create_deposit_id withdraw_to_deposit_id" - "&redirect_uri=rewards://bitflyer/authorization" - "&state=my-state" - "&response_type=code" - "&code_challenge_method=S256" - "&code_challenge=5Cxs3JXozcwTeteCIu4BcTieAhEIqjn643F10PxPD_w"); + std::string(kUrlProduction) + + "/ex/OAuth/authorize" + "?client_id=" BITFLYER_CLIENT_ID + "&scope=assets create_deposit_id withdraw_to_deposit_id" + "&redirect_uri=rewards://bitflyer/authorization" + "&state=my-state" + "&response_type=code" + "&code_challenge_method=S256" + "&code_challenge=5Cxs3JXozcwTeteCIu4BcTieAhEIqjn643F10PxPD_w"); // staging ledger::_environment = type::Environment::STAGING; @@ -110,7 +111,7 @@ TEST_F(BitflyerUtilTest, GetAddUrl) { // production ledger::_environment = type::Environment::PRODUCTION; std::string result = bitflyer::GetAddUrl(); - ASSERT_EQ(result, "https://bitflyer.jp/ex/Home?login=1"); + ASSERT_EQ(result, std::string(kUrlProduction) + "/ex/Home?login=1"); // staging ledger::_environment = type::Environment::STAGING; @@ -122,7 +123,7 @@ TEST_F(BitflyerUtilTest, GetWithdrawUrl) { // production ledger::_environment = type::Environment::PRODUCTION; std::string result = bitflyer::GetWithdrawUrl(); - ASSERT_EQ(result, "https://bitflyer.jp/ex/Home?login=1"); + ASSERT_EQ(result, std::string(kUrlProduction) + "/ex/Home?login=1"); // staging ledger::_environment = type::Environment::STAGING; @@ -138,17 +139,17 @@ TEST_F(BitflyerUtilTest, GetWallet) { ASSERT_TRUE(!result); const std::string wallet = R"({ - "account_url": "https://bitflyer.jp/ex/Home?login=1", + "account_url": "https://bitflyer.com/ex/Home?login=1", "add_url": "", "address": "2323dff2ba-d0d1-4dfw-8e56-a2605bcaf4af", "fees": {}, - "login_url": "https://sandbox.bitflyer.jp/authorize/4c2b665ca060d", + "login_url": "https://sandbox.bitflyer.com/authorize/4c2b665ca060d", "one_time_string": "1F747AE0A708E47ED7E650BF1856B5A4EF7E36833BDB1158A108F8", "code_verifier": "1234567890", "status": 2, "token": "4c80232r219c30cdf112208890a32c7e00", "user_name": "test", - "verify_url": "https://sandbox.bitflyer.jp/authorize/4c2b665ca060d", + "verify_url": "https://sandbox.bitflyer.com/authorize/4c2b665ca060d", "withdraw_url": "" })"; diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils.cc index 453d24fd9522..cb6e1c0562b3 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils.cc @@ -15,7 +15,7 @@ namespace endpoint { namespace bitflyer { const char kUrlStaging[] = BITFLYER_STAGING_URL; -const char kUrlProduction[] = "https://bitflyer.jp"; +const char kUrlProduction[] = "https://bitflyer.com"; std::string GetClientId() { return ::ledger::bitflyer::GetClientId(); diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils_unittest.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils_unittest.cc index 0ca791f51944..f16ef3fd35f5 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils_unittest.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/bitflyer_utils_unittest.cc @@ -31,7 +31,7 @@ TEST(BitflyerUtilsTest, GetServerUrlStaging) { TEST(BitflyerUtilsTest, GetServerUrlProduction) { ledger::_environment = type::Environment::PRODUCTION; const std::string url = GetServerUrl("/test"); - ASSERT_EQ(url, "https://bitflyer.jp/test"); + ASSERT_EQ(url, "https://bitflyer.com/test"); } } // namespace bitflyer diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h index 155140abf670..e69da320bc51 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h @@ -10,7 +10,7 @@ #include "bat/ledger/ledger.h" -// GET https://bitflyer.jp/api/link/v1/account/inventory +// GET https://bitflyer.com/api/link/v1/account/inventory // // Success code: // HTTP_OK (200) diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h index d48e850795bc..a11de4ec5492 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h @@ -10,7 +10,7 @@ #include "bat/ledger/ledger.h" -// POST https://bitflyer.jp/api/link/v1/token +// POST https://bitflyer.com/api/link/v1/token // // Request body: // { diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.h b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.h index ade477156c0c..13b67024b29b 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.h +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.h @@ -11,7 +11,7 @@ #include "bat/ledger/internal/bitflyer/bitflyer.h" #include "bat/ledger/ledger.h" -// POST https://bitflyer.jp/api/link/v1/coin/withdraw-to-deposit-id/request +// POST https://bitflyer.com/api/link/v1/coin/withdraw-to-deposit-id/request // // Request body: // {