From 1a9ed2ac488b3788610176d0e3d1d1be72d626eb Mon Sep 17 00:00:00 2001 From: dimxy Date: Sun, 7 Apr 2019 22:42:54 +0500 Subject: [PATCH] univalue ptr test --- src/wallet/rpcwallet.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 6fe061727..3a4331b25 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5848,8 +5848,26 @@ UniValue assetsaddress(const UniValue& params, bool fHelp) return(CCaddress(cp, (char *)"Assets", pubkey)); } +void f(UniValue *p1, UniValue *p2) { + + if (p1) + p1->push_back(make_pair("x", "y")); + + // or... + if (p2) + (*p2).push_back(make_pair("a", "b")); + +} + UniValue tokenaddress(const UniValue& params, bool fHelp) { + UniValue v1, v2; + f(&v1, &v2); + + std::cerr << v1.getValues()[0].get_str() << std::endl; + std::cerr << v2.getValues()[0].get_str() << std::endl; + + struct CCcontract_info *cp,C; std::vector pubkey; cp = CCinit(&C,EVAL_TOKENS); if ( fHelp || params.size() > 1 ) @@ -8102,3 +8120,14 @@ UniValue test_proof(const UniValue& params, bool fHelp) return result; } + +void f(UniValue *p) { + + if (p) + p->push_back(make_pair("x", "y")); + + // or... + if (p) + (*p).push_back(make_pair("x", "y")); + +} \ No newline at end of file