Skip to content

Commit

Permalink
Added comment and using nullopts instead of empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
spylogsster committed Feb 17, 2022
1 parent 64ec542 commit f2c5dcc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions browser/brave_wallet/brave_wallet_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ TEST_F(BraveWalletServiceUnitTest, SignMessageHardware) {
std::string message = "0xAB";
auto request1 = mojom::SignMessageRequest::New(
1, address, std::string(message.begin(), message.end()), false,
std::string(), std::string());
absl::nullopt, absl::nullopt);
bool callback_is_called = false;
service_->AddSignMessageRequest(
std::move(request1), base::BindLambdaForTesting(
Expand All @@ -1340,7 +1340,7 @@ TEST_F(BraveWalletServiceUnitTest, SignMessageHardware) {
std::string expected_error = "error";
auto request2 = mojom::SignMessageRequest::New(
2, address, std::string(message.begin(), message.end()), false,
std::string(), std::string());
absl::nullopt, absl::nullopt);
service_->AddSignMessageRequest(
std::move(request2), base::BindLambdaForTesting(
[&](bool approved, const std::string& signature,
Expand All @@ -1363,7 +1363,7 @@ TEST_F(BraveWalletServiceUnitTest, SignMessage) {
std::string message = "0xAB";
auto request1 = mojom::SignMessageRequest::New(
1, address, std::string(message.begin(), message.end()), false,
std::string(), std::string());
absl::nullopt, absl::nullopt);
bool callback_is_called = false;
service_->AddSignMessageRequest(
std::move(request1), base::BindLambdaForTesting(
Expand All @@ -1382,7 +1382,7 @@ TEST_F(BraveWalletServiceUnitTest, SignMessage) {
std::string expected_error = "error";
auto request2 = mojom::SignMessageRequest::New(
2, address, std::string(message.begin(), message.end()), false,
std::string(), std::string());
absl::nullopt, absl::nullopt);
service_->AddSignMessageRequest(
std::move(request2), base::BindLambdaForTesting(
[&](bool approved, const std::string& signature,
Expand Down Expand Up @@ -1575,7 +1575,7 @@ TEST_F(BraveWalletServiceUnitTest, Reset) {
std::string message = "0xAB";
auto request1 = mojom::SignMessageRequest::New(
1, address, std::string(message.begin(), message.end()), false,
std::string(), std::string());
absl::nullopt, absl::nullopt);
service_->AddSignMessageRequest(
std::move(request1),
base::BindLambdaForTesting(
Expand Down
2 changes: 2 additions & 0 deletions components/brave_wallet/common/brave_wallet.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,8 @@ struct SignMessageRequest {
string address;
string message;
bool is_eip712;
// These fields are for hardware eip712 signing and
// Should be used only if is_eip712 is true
string? domain_hash;
string? primary_hash;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "base/json/json_writer.h"
#include "base/no_destructor.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "brave/components/brave_wallet/common/eth_request_helper.h"
#include "brave/components/brave_wallet/common/hex_utils.h"
Expand Down

0 comments on commit f2c5dcc

Please sign in to comment.