MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / UnSerializeFromJson

Method UnSerializeFromJson

src/entities/keystore.cpp:33–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33bool CKeyCombi::UnSerializeFromJson(const Object& obj) {
34 try {
35 Object reply;
36 const Value& mCKey = find_value(obj, "mCkey");
37 if (mCKey.type() != json_spirit::null_type) {
38 auto const& tem1 = ::ParseHex(mCKey.get_str());
39 mMainCkey.Set(tem1.begin(), tem1.end(), true);
40 }
41 const Value& mMinerKey = find_value(obj, "mMinerCkey");
42 if (mMinerKey.type() != json_spirit::null_type) {
43 auto const& tem2 = ::ParseHex(mMinerKey.get_str());
44 mMinerCkey.Set(tem2.begin(), tem2.end(), true);
45 }
46 const Value& nTime = find_value(obj, "nCreationTime").get_int64();
47 if (nTime.type() != json_spirit::null_type) {
48 nCreationTime = find_value(obj, "nCreationTime").get_int64();
49 }
50 } catch (...) {
51 ERRORMSG("UnSerializeFromJson Failed !");
52 return false;
53 }
54
55 return true;
56}
57
58bool CKeyCombi::CleanAll() {
59 mMainCkey.Clear();

Callers 1

importwalletFunction · 0.80

Calls 6

ParseHexFunction · 0.85
typeMethod · 0.80
get_int64Method · 0.80
SetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected