Skip to content

Commit 25d0eb5

Browse files
authored
Feature/update post (#125)
* Added Sorted Public and Private Sector Info Signed-off-by: artyom-yurin <[email protected]> * Added generateCandidates Signed-off-by: artyom-yurin <[email protected]> * Added generatedPoSt Signed-off-by: artyom-yurin <[email protected]> * Added verifyPoSt Signed-off-by: artyom-yurin <[email protected]>
1 parent fc73d88 commit 25d0eb5

File tree

5 files changed

+210
-717
lines changed

5 files changed

+210
-717
lines changed

core/primitives/cid/comm_cid.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,12 @@ namespace fc::common {
7171

7272
return std::move(result);
7373
}
74+
75+
outcome::result<Comm> CIDToReplicaCommitmentV1(const CID &cid) {
76+
OUTCOME_TRY(result, CIDToCommitment(cid));
77+
if ((FilecoinHashType)result.getType() != FC_SEALED_V1) {
78+
return CommCidError::INVALID_HASH;
79+
}
80+
return cppCommitment(result.getHash());
81+
}
7482
} // namespace fc::common

core/primitives/cid/comm_cid.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ namespace fc::common {
7575
outcome::result<CID> commitmentToCID(gsl::span<const uint8_t> commitment,
7676
FilecoinMultihashCode code);
7777

78+
Comm cppCommitment(gsl::span<const uint8_t> bytes);
79+
7880
outcome::result<Comm> CIDToPieceCommitmentV1(const CID &cid);
81+
outcome::result<Comm> CIDToReplicaCommitmentV1(const CID &cid);
82+
7983
outcome::result<Comm> CIDToDataCommitmentV1(const CID &cid);
8084
outcome::result<Multihash> CIDToCommitment(const CID &cid);
8185

0 commit comments

Comments
 (0)