2
2
3
3
use fil_actor_account:: Method as AccountMethod ;
4
4
use fil_actor_market:: {
5
- BatchActivateDealsParams , BatchActivateDealsResult , DealActivation , DealSpaces ,
6
- Method as MarketMethod , OnMinerSectorsTerminateParams , SectorDealData , SectorDeals ,
5
+ BatchActivateDealsParams , BatchActivateDealsResult , DealSpaces , Method as MarketMethod ,
6
+ OnMinerSectorsTerminateParams , SectorDealActivation , SectorDealData , SectorDeals ,
7
7
VerifiedDealInfo , VerifyDealsForActivationParams , VerifyDealsForActivationReturn ,
8
8
} ;
9
9
use fil_actor_miner:: ext:: market:: ON_MINER_SECTORS_TERMINATE_METHOD ;
10
10
use fil_actor_miner:: ext:: power:: { UPDATE_CLAIMED_POWER_METHOD , UPDATE_PLEDGE_TOTAL_METHOD } ;
11
- use fil_actor_miner:: ext:: verifreg:: {
12
- ClaimAllocationsParams , ClaimAllocationsReturn , SectorAllocationClaim ,
13
- SectorAllocationClaimResult , CLAIM_ALLOCATIONS_METHOD ,
14
- } ;
11
+ use fil_actor_miner:: ext:: verifreg:: CLAIM_ALLOCATIONS_METHOD ;
15
12
use fil_actor_miner:: {
16
13
aggregate_pre_commit_network_fee, aggregate_prove_commit_network_fee, consensus_fault_penalty,
17
- initial_pledge_for_power, locked_reward_from_reward, max_prove_commit_duration,
14
+ ext , initial_pledge_for_power, locked_reward_from_reward, max_prove_commit_duration,
18
15
new_deadline_info_from_offset_and_epoch, pledge_penalty_for_continued_fault, power_for_sectors,
19
16
qa_power_for_sector, qa_power_for_weight, reward_for_consensus_slash_report, ActiveBeneficiary ,
20
17
Actor , ApplyRewardParams , BeneficiaryTerm , BitFieldQueue , ChangeBeneficiaryParams ,
@@ -1056,11 +1053,11 @@ impl ActorHarness {
1056
1053
let mut valid_pcs = Vec :: new ( ) ;
1057
1054
1058
1055
// claim FIL+ allocations
1059
- let mut sectors_claims: Vec < SectorAllocationClaim > = Vec :: new ( ) ;
1056
+ let mut sectors_claims: Vec < ext :: verifreg :: SectorAllocationClaims > = Vec :: new ( ) ;
1060
1057
1061
1058
// build expectations per sector
1062
1059
let mut sector_activation_params: Vec < SectorDeals > = Vec :: new ( ) ;
1063
- let mut sector_activations: Vec < DealActivation > = Vec :: new ( ) ;
1060
+ let mut sector_activations: Vec < SectorDealActivation > = Vec :: new ( ) ;
1064
1061
let mut sector_activation_results = BatchReturnGen :: new ( pcs. len ( ) ) ;
1065
1062
1066
1063
for pc in pcs {
@@ -1073,7 +1070,7 @@ impl ActorHarness {
1073
1070
} ;
1074
1071
sector_activation_params. push ( activate_params) ;
1075
1072
1076
- let ret = DealActivation {
1073
+ let ret = SectorDealActivation {
1077
1074
nonverified_deal_space : deal_spaces. deal_space ,
1078
1075
verified_infos : cfg
1079
1076
. verified_deal_infos
@@ -1094,25 +1091,23 @@ impl ActorHarness {
1094
1091
}
1095
1092
}
1096
1093
1097
- if ret. verified_infos . is_empty ( ) {
1098
- if activate_deals_exit == ExitCode :: OK {
1099
- valid_pcs. push ( pc) ;
1100
- }
1101
- } else {
1102
- let mut sector_claims: Vec < SectorAllocationClaim > = ret
1094
+ if activate_deals_exit == ExitCode :: OK {
1095
+ valid_pcs. push ( pc) ;
1096
+ let sector_claims = ret
1103
1097
. verified_infos
1104
1098
. iter ( )
1105
- . map ( |info| SectorAllocationClaim {
1099
+ . map ( |info| ext :: verifreg :: AllocationClaim {
1106
1100
client : info. client ,
1107
1101
allocation_id : info. allocation_id ,
1108
1102
data : info. data ,
1109
1103
size : info. size ,
1110
- sector : pc. info . sector_number ,
1111
- sector_expiry : pc. info . expiration ,
1112
1104
} )
1113
1105
. collect ( ) ;
1114
- sectors_claims. append ( & mut sector_claims) ;
1115
- valid_pcs. push ( pc) ;
1106
+ sectors_claims. push ( ext:: verifreg:: SectorAllocationClaims {
1107
+ sector : pc. info . sector_number ,
1108
+ expiry : pc. info . expiration ,
1109
+ claims : sector_claims,
1110
+ } ) ;
1116
1111
}
1117
1112
} else {
1118
1113
// empty deal ids
@@ -1121,11 +1116,16 @@ impl ActorHarness {
1121
1116
sector_expiry : pc. info . expiration ,
1122
1117
sector_type : RegisteredSealProof :: StackedDRG8MiBV1 ,
1123
1118
} ) ;
1124
- sector_activations. push ( DealActivation {
1119
+ sector_activations. push ( SectorDealActivation {
1125
1120
nonverified_deal_space : BigInt :: zero ( ) ,
1126
1121
verified_infos : vec ! [ ] ,
1127
1122
} ) ;
1128
1123
sector_activation_results. add_success ( ) ;
1124
+ sectors_claims. push ( ext:: verifreg:: SectorAllocationClaims {
1125
+ sector : pc. info . sector_number ,
1126
+ expiry : pc. info . expiration ,
1127
+ claims : vec ! [ ] ,
1128
+ } ) ;
1129
1129
valid_pcs. push ( pc) ;
1130
1130
}
1131
1131
}
@@ -1148,20 +1148,24 @@ impl ActorHarness {
1148
1148
) ;
1149
1149
}
1150
1150
1151
- if !sectors_claims. is_empty ( ) {
1152
- let claim_allocation_params = ClaimAllocationsParams {
1153
- allocations : sectors_claims. clone ( ) ,
1151
+ if !sectors_claims. iter ( ) . all ( |c| c . claims . is_empty ( ) ) {
1152
+ let claim_allocation_params = ext :: verifreg :: ClaimAllocationsParams {
1153
+ sectors : sectors_claims. clone ( ) ,
1154
1154
all_or_nothing : true ,
1155
1155
} ;
1156
1156
1157
1157
// TODO handle failures of claim allocations
1158
1158
// use exit code map for claim allocations in config
1159
- let claim_allocs_ret = ClaimAllocationsReturn {
1160
- claims : sectors_claims
1159
+ let claim_allocs_ret = ext:: verifreg:: ClaimAllocationsReturn {
1160
+ sector_results : BatchReturn :: ok ( sectors_claims. len ( ) as u32 ) ,
1161
+ sector_claims : sectors_claims
1161
1162
. iter ( )
1162
- . map ( |claim| SectorAllocationClaimResult { claimed_space : claim. size . 0 . into ( ) } )
1163
+ . map ( |sector| ext:: verifreg:: SectorClaimSummary {
1164
+ claimed_space : BigInt :: from (
1165
+ sector. claims . iter ( ) . map ( |c| c. size . 0 ) . sum :: < u64 > ( ) ,
1166
+ ) ,
1167
+ } )
1163
1168
. collect ( ) ,
1164
- claim_results : BatchReturn :: ok ( sectors_claims. len ( ) as u32 ) ,
1165
1169
} ;
1166
1170
rt. expect_send_simple (
1167
1171
VERIFIED_REGISTRY_ACTOR_ADDR ,
0 commit comments