11
11
12
12
#include " base/base64.h"
13
13
#include " base/json/json_writer.h"
14
+ #include " base/strings/string_number_conversions.h"
14
15
#include " base/strings/stringprintf.h"
15
16
#include " base/values.h"
16
17
#include " bat/ledger/internal/common/security_helper.h"
@@ -28,14 +29,12 @@ using std::placeholders::_2;
28
29
namespace {
29
30
30
31
std::string GeneratePayload (
31
- const std::string& user_funds,
32
+ const double user_funds,
32
33
const std::string& address,
33
34
const std::string& anon_address,
34
35
const std::vector<uint8_t >& seed) {
35
- const std::string amount = user_funds.empty () ? " 0" : user_funds;
36
-
37
36
base::Value denomination (base::Value::Type::DICTIONARY);
38
- denomination.SetStringKey (" amount" , amount );
37
+ denomination.SetStringKey (" amount" , base::NumberToString (user_funds) );
39
38
denomination.SetStringKey (" currency" , " BAT" );
40
39
41
40
base::Value octets (base::Value::Type::DICTIONARY);
@@ -109,7 +108,7 @@ void WalletClaim::OnBalance(
109
108
}
110
109
111
110
if (ledger_->GetBooleanState (ledger::kStateAnonTransferChecked ) &&
112
- balance->user_funds == " 0 " ) {
111
+ balance->user_funds == 0 ) {
113
112
BLOG (1 , " Second ping with zero balance" );
114
113
callback (ledger::Result::LEDGER_OK);
115
114
return ;
@@ -144,7 +143,7 @@ void WalletClaim::OnBalance(
144
143
145
144
void WalletClaim::TransferFunds (
146
145
const ledger::Result result,
147
- const std::string user_funds,
146
+ const double user_funds,
148
147
ledger::ResultCallback callback) {
149
148
auto wallets = ledger_->GetExternalWallets ();
150
149
auto wallet_ptr = braveledger_uphold::GetWallet (std::move (wallets));
0 commit comments