mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Implemented hp-sc comm channel. (#32)
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -108,7 +108,8 @@ int main(int argc, char **argv)
|
||||
|
||||
while (true)
|
||||
{
|
||||
sleep(1);
|
||||
sleep(2);
|
||||
|
||||
// Test code to execute contract and collect outputs.
|
||||
std::unordered_map<std::string, std::pair<std::string, std::string>> userbufs;
|
||||
for (auto &[sid, user] : usr::users)
|
||||
@@ -121,8 +122,10 @@ int main(int argc, char **argv)
|
||||
bufpair.first = std::move(inputtosend);
|
||||
userbufs[user.pubkey] = bufpair;
|
||||
}
|
||||
std::pair<std::string, std::string> hpscbufpair;
|
||||
hpscbufpair.first = "{msg:'Message from HP'}";
|
||||
|
||||
proc::ContractExecArgs eargs(123123345, userbufs);
|
||||
proc::ContractExecArgs eargs(123123345, userbufs, hpscbufpair);
|
||||
proc::exec_contract(eargs);
|
||||
|
||||
for (auto &[pubkey, bufpair] : userbufs)
|
||||
@@ -139,6 +142,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!hpscbufpair.second.empty())
|
||||
std::cout << "Message from SC: " << hpscbufpair.second << std::endl;
|
||||
|
||||
userbufs.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user