1313#include " api/rpc/rpc.hpp"
1414#include " api/storage_miner/storage_api.hpp"
1515#include " api/types/key_info.hpp"
16+ #include " api/types/ledger_key_info.hpp"
1617#include " api/worker_api.hpp"
1718#include " common/enum.hpp"
1819#include " common/libp2p/peer/cbor_peer_info.hpp"
@@ -324,6 +325,20 @@ namespace fc::api {
324325 }
325326 }
326327
328+ ENCODE (uint32_t ) {
329+ return Value{v};
330+ }
331+
332+ DECODE (uint32_t ) {
333+ if (j.IsUint ()) {
334+ v = j.GetUint ();
335+ } else if (j.IsString ()) {
336+ v = strtoull (j.GetString (), nullptr , 10 );
337+ } else {
338+ outcome::raise (JsonError::kWrongType );
339+ }
340+ }
341+
327342 ENCODE (double ) {
328343 return Value{v};
329344 }
@@ -523,6 +538,18 @@ namespace fc::api {
523538 }
524539 }
525540
541+ ENCODE (LedgerKeyInfo) {
542+ Value j{rapidjson::kObjectType };
543+ Set (j, " Address" , v.address );
544+ Set (j, " Path" , v.path );
545+ return j;
546+ }
547+
548+ DECODE (LedgerKeyInfo) {
549+ Get (j, " Address" , v.address );
550+ Get (j, " Path" , v.path );
551+ }
552+
526553 ENCODE (PoStProof) {
527554 Value j{rapidjson::kObjectType };
528555 Set (j, " PoStProof" , v.registered_proof );
@@ -546,7 +573,7 @@ namespace fc::api {
546573 ENCODE (CallError) {
547574 Value j{rapidjson::kObjectType };
548575 Set (j, " Code" , v.code );
549- Set (j, " ProofBytes " , v.message );
576+ Set (j, " Message " , v.message );
550577 return j;
551578 }
552579
0 commit comments