Skip to content

Commit

Permalink
Merge pull request #27 from Doy-lee/doyle-fix-get-contract-deploys-in…
Browse files Browse the repository at this point in the history
…-latest-block

Fix get contract deployed in latest block, request returns result object
  • Loading branch information
Doy-lee authored Jul 5, 2024
2 parents b476236 + 1ef9490 commit bb4dd3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ std::string Provider::getContractDeployedInLatestBlock() {
throw std::runtime_error("Failed to get the latest block");

nlohmann::json blockJson = *result;
for (const auto& tx : blockJson["result"]["transactions"]) {
for (const auto& tx : blockJson["transactions"]) {
std::optional<nlohmann::json> transactionReceipt = getTransactionReceipt(tx["hash"].get<std::string>());
if (transactionReceipt.has_value())
return transactionReceipt->at("contractAddress").get<std::string>();
Expand Down

0 comments on commit bb4dd3a

Please sign in to comment.