Skip to content

Commit

Permalink
Uplift of #14088 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-browser-releases committed Jul 11, 2022
1 parent 5eb856d commit ce1914d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/brave_wallet/browser/eth_requests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ std::string eth_blockNumber() {
return GetJsonRpcNoParams("eth_blockNumber");
}

std::string eth_feeHistory(int num_blocks,
std::string eth_feeHistory(const std::string& num_blocks,
const std::string& head,
const std::vector<double>& reward_percentiles) {
base::Value percentile_values(base::Value::Type::LIST);
Expand Down
2 changes: 1 addition & 1 deletion components/brave_wallet/browser/eth_requests.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std::string eth_accounts();
// Returns the number of most recent block.
std::string eth_blockNumber();
// Returns the fee history.
std::string eth_feeHistory(int num_blocks,
std::string eth_feeHistory(const std::string& num_blocks,
const std::string& head,
const std::vector<double>& reward_percentiles);
// Returns the balance of the account of given address.
Expand Down
4 changes: 2 additions & 2 deletions components/brave_wallet/browser/eth_requests_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ TEST(EthRequestUnitTest, eth_blockNumber) {

TEST(EthRequestUnitTest, eth_feeHistory) {
ASSERT_EQ(
eth_feeHistory(40, "latest", std::vector<double>{20, 50, 80}),
R"({"id":1,"jsonrpc":"2.0","method":"eth_feeHistory","params":[40,"latest",[20.0,50.0,80.0]]})");
eth_feeHistory("0x28", "latest", std::vector<double>{20, 50, 80}),
R"({"id":1,"jsonrpc":"2.0","method":"eth_feeHistory","params":["0x28","latest",[20.0,50.0,80.0]]})");
}

TEST(EthRequestUnitTest, eth_getBalance) {
Expand Down
5 changes: 3 additions & 2 deletions components/brave_wallet/browser/json_rpc_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,9 @@ void JsonRpcService::GetFeeHistory(GetFeeHistoryCallback callback) {
weak_ptr_factory_.GetWeakPtr(), std::move(callback));

RequestInternal(
eth::eth_feeHistory(40, "latest", std::vector<double>{20, 50, 80}), true,
network_urls_[mojom::CoinType::ETH], std::move(internal_callback));
eth::eth_feeHistory("0x28", // blockCount = 40
"latest", std::vector<double>{20, 50, 80}),
true, network_urls_[mojom::CoinType::ETH], std::move(internal_callback));
}

void JsonRpcService::OnGetFeeHistory(
Expand Down

0 comments on commit ce1914d

Please sign in to comment.