diff --git a/include/bat/ledger/grant.h b/include/bat/ledger/grant.h index 3f66f6a069a6..9da0e708c68d 100644 --- a/include/bat/ledger/grant.h +++ b/include/bat/ledger/grant.h @@ -21,7 +21,7 @@ LEDGER_EXPORT struct Grant { std::string altcurrency; std::string probi; std::string promotionId; - unsigned int expiryTime; + uint64_t expiryTime; }; } // namespace ledger diff --git a/include/bat/ledger/ledger_client.h b/include/bat/ledger/ledger_client.h index 11ad22783630..cc595cb75a92 100644 --- a/include/bat/ledger/ledger_client.h +++ b/include/bat/ledger/ledger_client.h @@ -60,11 +60,11 @@ class LEDGER_EXPORT LedgerClient { GetPublisherInfoListCallback callback) = 0; virtual void GetGrant(const std::string& lang, const std::string& paymentId) = 0; - virtual void OnGrant(ledger::Result result, ledger::Grant) = 0; + virtual void OnGrant(ledger::Result result, const ledger::Grant& grant) = 0; virtual void GetGrantCaptcha() = 0; virtual void OnGrantCaptcha(const std::string& image) = 0; - virtual void OnRecoverWallet(Result result, double balance, std::vector grants) = 0; - virtual void OnGrantFinish(ledger::Result result, ledger::Grant grant) = 0; + virtual void OnRecoverWallet(Result result, double balance, const std::vector& grants) = 0; + virtual void OnGrantFinish(ledger::Result result, const ledger::Grant& grant) = 0; virtual std::string URIEncode(const std::string& value) = 0; diff --git a/src/bat_client.cc b/src/bat_client.cc index c37bd572269d..cd0e8b65258a 100644 --- a/src/bat_client.cc +++ b/src/bat_client.cc @@ -894,7 +894,8 @@ void BatClient::recoverWallet(const std::string& passPhrase) { int result = bip39_mnemonic_to_bytes(nullptr, passPhrase.c_str(), &newSeed.front(), newSeed.size(), &written); LOG(ERROR) << "!!!recoverWallet result == " << result << "!!!result size == " << written; if (0 != result || 0 == written) { - ledger_->OnRecoverWallet(ledger::Result::ERROR, 0, std::vector()); + std::vector empty; + ledger_->OnRecoverWallet(ledger::Result::ERROR, 0, empty); return; } state_->walletInfo_.keyInfoSeed_ = newSeed; @@ -921,7 +922,8 @@ void BatClient::recoverWalletPublicKeyCallback(bool result, const std::string& r LOG(ERROR) << "!!!recoverWalletPublicKeyCallback == " << response; if (!result) { - ledger_->OnRecoverWallet(ledger::Result::ERROR, 0, std::vector()); + std::vector empty; + ledger_->OnRecoverWallet(ledger::Result::ERROR, 0, empty); return; } std::string recoveryId; @@ -941,7 +943,8 @@ void BatClient::recoverWalletCallback(bool result, const std::string& response, LOG(ERROR) << "!!!recoverWalletCallback == " << response; if (!result) { - ledger_->OnRecoverWallet(ledger::Result::ERROR, 0, std::vector()); + std::vector empty; + ledger_->OnRecoverWallet(ledger::Result::ERROR, 0, empty); return; } diff --git a/src/ledger_impl.cc b/src/ledger_impl.cc index 8cad3de2f3f3..5da8f755fae3 100644 --- a/src/ledger_impl.cc +++ b/src/ledger_impl.cc @@ -418,7 +418,7 @@ void LedgerImpl::RecoverWallet(const std::string& passPhrase) const { bat_client_->recoverWallet(passPhrase); } -void LedgerImpl::OnRecoverWallet(ledger::Result result, double balance, std::vector grants) { +void LedgerImpl::OnRecoverWallet(ledger::Result result, double balance, const std::vector& grants) { std::vector ledgerGrants; for (size_t i = 0; i < grants.size(); i ++) { @@ -441,7 +441,7 @@ void LedgerImpl::SolveGrantCaptcha(const std::string& solution) const { bat_client_->setGrant(solution, ""); } -void LedgerImpl::OnGrantFinish(ledger::Result result, braveledger_bat_helper::GRANT grant) { +void LedgerImpl::OnGrantFinish(ledger::Result result, const braveledger_bat_helper::GRANT& grant) { ledger::Grant newGrant; newGrant.altcurrency = grant.altcurrency; diff --git a/src/ledger_impl.h b/src/ledger_impl.h index 0c084000357f..26fd8628a592 100644 --- a/src/ledger_impl.h +++ b/src/ledger_impl.h @@ -83,17 +83,17 @@ class LedgerImpl : public ledger::Ledger, void GetWalletProperties() const override; void GetGrant(const std::string& lang, const std::string& paymentId) const override; - void OnGrant(ledger::Result result, const braveledger_bat_helper::GRANT&); + void OnGrant(ledger::Result result, const braveledger_bat_helper::GRANT& grant); void GetGrantCaptcha() const override; void OnGrantCaptcha(const std::string& image); void SolveGrantCaptcha(const std::string& solution) const override; - void OnGrantFinish(ledger::Result result, braveledger_bat_helper::GRANT grant); + void OnGrantFinish(ledger::Result result, const braveledger_bat_helper::GRANT& grant); std::string GetWalletPassphrase() const override; void RecoverWallet(const std::string& passPhrase) const override; - void OnRecoverWallet(ledger::Result result, double balance, std::vector grants); + void OnRecoverWallet(ledger::Result result, double balance, const std::vector& grants); std::unique_ptr LoadURL(const std::string& url, const std::vector& headers,