@@ -82,71 +82,63 @@ impl HasLotusJson for MinerInfo {
8282 "WorkerChangeEpoch" : 0
8383 } ) ,
8484 Self {
85- owner: Address :: default ( ) . into ( ) ,
86- worker: Address :: default ( ) . into ( ) ,
85+ owner: Address :: default ( ) ,
86+ worker: Address :: default ( ) ,
8787 new_worker: Default :: default ( ) ,
8888 control_addresses: Default :: default ( ) ,
8989 worker_change_epoch: Default :: default ( ) ,
9090 peer_id: Default :: default ( ) ,
9191 multiaddrs: Default :: default ( ) ,
9292 window_post_proof_type:
9393 fvm_shared2:: sector:: RegisteredPoStProof :: StackedDRGWinning2KiBV1 ,
94- sector_size: crate :: shim:: sector:: SectorSize :: _2KiB. into ( ) ,
94+ sector_size: crate :: shim:: sector:: SectorSize :: _2KiB,
9595 window_post_partition_sectors: Default :: default ( ) ,
9696 consensus_fault_elapsed: Default :: default ( ) ,
9797 pending_owner_address: Default :: default ( ) ,
98- beneficiary: Address :: default ( ) . into ( ) ,
98+ beneficiary: Address :: default ( ) ,
9999 beneficiary_term: Default :: default ( ) ,
100100 pending_beneficiary_term: Default :: default ( ) ,
101101 } ,
102102 ) ]
103103 }
104104 fn into_lotus_json ( self ) -> Self :: LotusJson {
105105 MinerInfoLotusJson {
106- owner : self . owner . into ( ) ,
107- worker : self . worker . into ( ) ,
108- new_worker : AddressOrEmpty ( self . new_worker . map ( |addr| addr. into ( ) ) ) ,
109- control_addresses : self
110- . control_addresses
111- . into_iter ( )
112- . map ( |a| a. into ( ) )
113- . collect ( ) ,
106+ owner : self . owner ,
107+ worker : self . worker ,
108+ new_worker : AddressOrEmpty ( self . new_worker ) ,
109+ control_addresses : self . control_addresses ,
114110 worker_change_epoch : self . worker_change_epoch ,
115111 peer_id : PeerId :: try_from ( self . peer_id ) . map ( |id| id. to_base58 ( ) ) . ok ( ) ,
116112 multiaddrs : self . multiaddrs . into_iter ( ) . map ( |addr| addr. 0 ) . collect ( ) ,
117113 window_po_st_proof_type : self . window_post_proof_type ,
118- sector_size : self . sector_size . into ( ) ,
114+ sector_size : self . sector_size ,
119115 window_po_st_partition_sectors : self . window_post_partition_sectors ,
120116 consensus_fault_elapsed : self . consensus_fault_elapsed ,
121117 // NOTE: In Lotus this field is never set for any of the versions, so we have to ignore
122118 // it too.
123119 // See: <https://github.com/filecoin-project/lotus/blob/b6a77dfafcf0110e95840fca15a775ed663836d8/chain/actors/builtin/miner/v12.go#L370>.
124120 pending_owner_address : None ,
125- beneficiary : self . beneficiary . into ( ) ,
121+ beneficiary : self . beneficiary ,
126122 beneficiary_term : self . beneficiary_term ,
127123 pending_beneficiary_term : self . pending_beneficiary_term ,
128124 }
129125 }
130126 fn from_lotus_json ( lotus_json : Self :: LotusJson ) -> Self {
131127 MinerInfo {
132- owner : lotus_json. owner . into ( ) ,
133- worker : lotus_json. worker . into ( ) ,
134- new_worker : lotus_json. new_worker . 0 . map ( |addr| addr. into ( ) ) ,
135- control_addresses : lotus_json
136- . control_addresses
137- . into_iter ( )
138- . map ( |a| a. into ( ) )
139- . collect ( ) ,
128+ owner : lotus_json. owner ,
129+ worker : lotus_json. worker ,
130+ new_worker : lotus_json. new_worker . 0 ,
131+ control_addresses : lotus_json. control_addresses ,
140132 worker_change_epoch : lotus_json. worker_change_epoch ,
141133 peer_id : lotus_json. peer_id . map_or_else ( Vec :: new, |s| s. into_bytes ( ) ) ,
142134 multiaddrs : lotus_json. multiaddrs . into_iter ( ) . map ( BytesDe ) . collect ( ) ,
143135 window_post_proof_type : lotus_json. window_po_st_proof_type ,
144- sector_size : lotus_json. sector_size . into ( ) ,
136+ sector_size : lotus_json. sector_size ,
145137 window_post_partition_sectors : lotus_json. window_po_st_partition_sectors ,
146138 consensus_fault_elapsed : lotus_json. consensus_fault_elapsed ,
147139 // Ignore this field as it is never set on Lotus side.
148140 pending_owner_address : None ,
149- beneficiary : lotus_json. beneficiary . into ( ) ,
141+ beneficiary : lotus_json. beneficiary ,
150142 beneficiary_term : lotus_json. beneficiary_term ,
151143 pending_beneficiary_term : lotus_json. pending_beneficiary_term ,
152144 }
0 commit comments