Skip to content

Commit e15a800

Browse files
committed
refactor: use qry.processor for getPkiDocument
1 parent b38123f commit e15a800

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,11 @@ const executeCommand = async (
478478
.action(async (epoch: number) => {
479479
if (!ipfsNode) return callback(responses.IPFS_NOT_STARTED);
480480

481-
const cid_ = await client.query.runtime.Pki.documents.get(
482-
Field.from(epoch),
483-
);
484-
if (!cid_) return callback(responses.RECORD_NOT_FOUND);
481+
const doc = await qry.processor.getPkiDocument(epoch);
482+
if (!doc) return callback(responses.RECORD_NOT_FOUND);
485483

486484
// get data from IPFS by cid
487-
const cid = cid_.toString();
485+
const cid = doc.cid;
488486
const data = await ipfsNode.getBytes(cid);
489487

490488
const debug = { epoch, cid };

0 commit comments

Comments
 (0)