Skip to content

Commit 6d230bb

Browse files
authored
Fix api call in sealing test (#486)
Signed-off-by: ortyomka <[email protected]>
1 parent 9bb5b00 commit 6d230bb

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

test/core/miner/checks_test.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ namespace fc::mining::checks {
573573
return codec::cbor::encode(actor_state_);
574574
}
575575
if (key == cid_root) {
576-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
576+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
577577
return codec::cbor::encode(root);
578578
}
579579
if (key == actor_state_->allocated_sectors) {
@@ -686,7 +686,7 @@ namespace fc::mining::checks {
686686
return codec::cbor::encode(actor_state_);
687687
}
688688
if (key == cid_root) {
689-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
689+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
690690
return codec::cbor::encode(root);
691691
}
692692
if (key == actor_state_->allocated_sectors) {
@@ -786,7 +786,7 @@ namespace fc::mining::checks {
786786
return codec::cbor::encode(actor_state_);
787787
}
788788
if (key == cid_root) {
789-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
789+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
790790
return codec::cbor::encode(root);
791791
}
792792
if (key == actor_state_->allocated_sectors) {
@@ -838,7 +838,7 @@ namespace fc::mining::checks {
838838
return codec::cbor::encode(actor_state_);
839839
}
840840
if (key == cid_root) {
841-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
841+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
842842
return codec::cbor::encode(root);
843843
}
844844
if (key == actor_state_->allocated_sectors) {
@@ -891,7 +891,7 @@ namespace fc::mining::checks {
891891
return codec::cbor::encode(actor_state_);
892892
}
893893
if (key == cid_root) {
894-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
894+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
895895
return codec::cbor::encode(root);
896896
}
897897
if (key == actor_state_->allocated_sectors) {
@@ -944,7 +944,7 @@ namespace fc::mining::checks {
944944
return codec::cbor::encode(actor_state_);
945945
}
946946
if (key == cid_root) {
947-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
947+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
948948
return codec::cbor::encode(root);
949949
}
950950
if (key == actor_state_->allocated_sectors) {
@@ -1015,7 +1015,7 @@ namespace fc::mining::checks {
10151015
return codec::cbor::encode(actor_state_);
10161016
}
10171017
if (key == cid_root) {
1018-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
1018+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
10191019
return codec::cbor::encode(root);
10201020
}
10211021
if (key == actor_state_->allocated_sectors) {
@@ -1084,7 +1084,7 @@ namespace fc::mining::checks {
10841084
return codec::cbor::encode(actor_state_);
10851085
}
10861086
if (key == cid_root) {
1087-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
1087+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld_, cid_root));
10881088
return codec::cbor::encode(root);
10891089
}
10901090
if (key == actor_state_->allocated_sectors) {

test/core/miner/sealing_test.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ namespace fc::mining {
678678
return codec::cbor::encode(actor_state);
679679
}
680680
if (key == cid_root) {
681-
OUTCOME_TRY(root, getCbor<storage::hamt::Node>(ipld, cid_root));
681+
EXPECT_OUTCOME_TRUE(root, getCbor<storage::hamt::Node>(ipld, cid_root));
682682
return codec::cbor::encode(root);
683683
}
684684
if (key == actor_state->allocated_sectors) {
@@ -726,7 +726,7 @@ namespace fc::mining {
726726
const TipsetKey &tipset_key) -> outcome::result<InvocResult> {
727727
InvocResult result;
728728
ComputeDataCommitment::Result call_res{.commds = {cids.unsealed_cid}};
729-
OUTCOME_TRY(unsealed_buffer, codec::cbor::encode(call_res));
729+
EXPECT_OUTCOME_TRUE(unsealed_buffer, codec::cbor::encode(call_res));
730730
result.receipt = MessageReceipt{
731731
.exit_code = vm::VMExitCode::kOk,
732732
.return_value = unsealed_buffer,
@@ -777,9 +777,11 @@ namespace fc::mining {
777777
SectorPreCommitOnChainInfo new_info;
778778
new_info.precommit_epoch = height;
779779
new_info.info.sealed_cid = cids.sealed_cid;
780-
OUTCOME_TRY(actor_state->precommitted_sectors.set(sector, new_info));
781-
OUTCOME_TRYA(cid_root,
782-
actor_state->precommitted_sectors.hamt.flush());
780+
EXPECT_OUTCOME_TRUE_1(
781+
actor_state->precommitted_sectors.set(sector, new_info));
782+
EXPECT_OUTCOME_TRUE(cid_root_res,
783+
actor_state->precommitted_sectors.hamt.flush());
784+
cid_root = std::move(cid_root_res);
783785
}
784786

785787
MsgWait result;
@@ -813,7 +815,7 @@ namespace fc::mining {
813815
height + kPreCommitChallengeDelay))
814816
.WillOnce(testing::Invoke(
815817
[](auto &apply, auto, auto, auto) -> outcome::result<void> {
816-
OUTCOME_TRY(apply({}, 0));
818+
EXPECT_OUTCOME_TRUE_1(apply({}, 0));
817819
return outcome::success();
818820
}));
819821

0 commit comments

Comments
 (0)