Skip to content

Commit 11e8590

Browse files
committed
Drop Cbor impl for method params and return types
1 parent ada5a7e commit 11e8590

File tree

9 files changed

+6
-94
lines changed

9 files changed

+6
-94
lines changed

actors/account/src/types.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use fvm_ipld_encoding::serde_bytes;
12
use fvm_ipld_encoding::tuple::*;
2-
use fvm_ipld_encoding::{serde_bytes, Cbor};
33

44
#[derive(Debug, Serialize_tuple, Deserialize_tuple)]
55
pub struct AuthenticateMessageParams {
@@ -8,5 +8,3 @@ pub struct AuthenticateMessageParams {
88
#[serde(with = "serde_bytes")]
99
pub message: Vec<u8>,
1010
}
11-
12-
impl Cbor for AuthenticateMessageParams {}

actors/datacap/src/types.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use fvm_ipld_encoding::tuple::*;
2-
use fvm_ipld_encoding::Cbor;
32
use fvm_shared::address::Address;
43
use fvm_shared::econ::TokenAmount;
54

@@ -13,12 +12,8 @@ pub struct MintParams {
1312
pub operators: Vec<Address>,
1413
}
1514

16-
impl Cbor for MintParams {}
17-
1815
#[derive(Clone, Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
1916
pub struct DestroyParams {
2017
pub owner: Address,
2118
pub amount: TokenAmount,
2219
}
23-
24-
impl Cbor for DestroyParams {}

actors/init/src/types.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use cid::Cid;
55
use fvm_ipld_encoding::tuple::*;
6-
use fvm_ipld_encoding::{Cbor, RawBytes};
6+
use fvm_ipld_encoding::RawBytes;
77
use fvm_shared::address::Address;
88

99
/// Init actor Constructor parameters
@@ -27,6 +27,3 @@ pub struct ExecReturn {
2727
/// Reorg safe address for actor
2828
pub robust_address: Address,
2929
}
30-
31-
impl Cbor for ExecReturn {}
32-
impl Cbor for ExecParams {}

actors/market/src/types.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use cid::Cid;
66
use fil_actors_runtime::Array;
77
use fvm_ipld_bitfield::BitField;
88
use fvm_ipld_encoding::tuple::*;
9-
use fvm_ipld_encoding::Cbor;
109
use fvm_shared::address::Address;
1110
use fvm_shared::bigint::{bigint_ser, BigInt};
1211
use fvm_shared::clock::ChainEpoch;
@@ -28,8 +27,6 @@ pub struct WithdrawBalanceParams {
2827
pub amount: TokenAmount,
2928
}
3029

31-
impl Cbor for WithdrawBalanceParams {}
32-
3330
#[derive(Serialize_tuple, Deserialize_tuple)]
3431
#[serde(transparent)]
3532
pub struct WithdrawBalanceReturn {
@@ -54,8 +51,6 @@ pub struct PublishStorageDealsParams {
5451
pub deals: Vec<ClientDealProposal>,
5552
}
5653

57-
impl Cbor for PublishStorageDealsParams {}
58-
5954
#[derive(Serialize_tuple, Deserialize_tuple, Debug)]
6055
pub struct PublishStorageDealsReturn {
6156
pub ids: Vec<DealID>,

actors/miner/src/types.rs

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use cid::Cid;
55
use fvm_ipld_bitfield::BitField;
66
use fvm_ipld_encoding::tuple::*;
7-
use fvm_ipld_encoding::{serde_bytes, BytesDe, Cbor};
7+
use fvm_ipld_encoding::{serde_bytes, BytesDe};
88
use fvm_shared::address::Address;
99
use fvm_shared::bigint::bigint_ser;
1010
use fvm_shared::clock::ChainEpoch;
@@ -119,17 +119,13 @@ pub struct SubmitWindowedPoStParams {
119119
pub chain_commit_rand: Randomness,
120120
}
121121

122-
impl Cbor for SubmitWindowedPoStParams {}
123-
124122
#[derive(Serialize_tuple, Deserialize_tuple)]
125123
pub struct ProveCommitSectorParams {
126124
pub sector_number: SectorNumber,
127125
#[serde(with = "serde_bytes")]
128126
pub proof: Vec<u8>,
129127
}
130128

131-
impl Cbor for ProveCommitSectorParams {}
132-
133129
#[derive(Serialize_tuple, Deserialize_tuple)]
134130
pub struct CheckSectorProvenParams {
135131
pub sector_number: SectorNumber,
@@ -140,8 +136,6 @@ pub struct ExtendSectorExpirationParams {
140136
pub extensions: Vec<ExpirationExtension>,
141137
}
142138

143-
impl Cbor for ExtendSectorExpirationParams {}
144-
145139
#[derive(Serialize_tuple, Deserialize_tuple)]
146140
pub struct ExpirationExtension {
147141
pub deadline: u64,
@@ -155,17 +149,13 @@ pub struct ExtendSectorExpiration2Params {
155149
pub extensions: Vec<ExpirationExtension2>,
156150
}
157151

158-
impl Cbor for ExtendSectorExpiration2Params {}
159-
160152
#[derive(Clone, Debug, Serialize_tuple, Deserialize_tuple)]
161153
pub struct SectorClaim {
162154
pub sector_number: SectorNumber,
163155
pub maintain_claims: Vec<ClaimID>,
164156
pub drop_claims: Vec<ClaimID>,
165157
}
166158

167-
impl Cbor for SectorClaim {}
168-
169159
#[derive(Clone, Debug, Serialize_tuple, Deserialize_tuple)]
170160
pub struct ExpirationExtension2 {
171161
pub deadline: u64,
@@ -175,8 +165,6 @@ pub struct ExpirationExtension2 {
175165
pub new_expiration: ChainEpoch,
176166
}
177167

178-
impl Cbor for ExpirationExtension2 {}
179-
180168
// From is straightforward when there are no claim bearing sectors
181169
impl From<&ExpirationExtension> for ExpirationExtension2 {
182170
fn from(e: &ExpirationExtension) -> Self {
@@ -195,8 +183,6 @@ pub struct TerminateSectorsParams {
195183
pub terminations: Vec<TerminationDeclaration>,
196184
}
197185

198-
impl Cbor for TerminateSectorsParams {}
199-
200186
#[derive(Serialize_tuple, Deserialize_tuple)]
201187
pub struct TerminationDeclaration {
202188
pub deadline: u64,
@@ -234,8 +220,6 @@ pub struct DeclareFaultsRecoveredParams {
234220
pub recoveries: Vec<RecoveryDeclaration>,
235221
}
236222

237-
impl Cbor for DeclareFaultsRecoveredParams {}
238-
239223
#[derive(Serialize_tuple, Deserialize_tuple)]
240224
pub struct RecoveryDeclaration {
241225
/// The deadline to which the recovered sectors are assigned, in range [0..WPoStPeriodDeadlines)
@@ -246,8 +230,6 @@ pub struct RecoveryDeclaration {
246230
pub sectors: BitField,
247231
}
248232

249-
impl Cbor for RecoveryDeclaration {}
250-
251233
#[derive(Serialize_tuple, Deserialize_tuple)]
252234
pub struct CompactPartitionsParams {
253235
pub deadline: u64,
@@ -274,8 +256,6 @@ pub struct WithdrawBalanceParams {
274256
pub amount_requested: TokenAmount,
275257
}
276258

277-
impl Cbor for WithdrawBalanceParams {}
278-
279259
#[derive(Serialize_tuple, Deserialize_tuple)]
280260
#[serde(transparent)]
281261
pub struct WithdrawBalanceReturn {
@@ -308,21 +288,16 @@ pub struct PreCommitSectorParams {
308288
pub replace_sector_number: SectorNumber,
309289
}
310290

311-
impl Cbor for PreCommitSectorParams {}
312-
313291
#[derive(Debug, PartialEq, Eq, Clone, Serialize_tuple, Deserialize_tuple)]
314292
pub struct PreCommitSectorBatchParams {
315293
pub sectors: Vec<PreCommitSectorParams>,
316294
}
317-
impl Cbor for PreCommitSectorBatchParams {}
318295

319296
#[derive(Debug, PartialEq, Eq, Clone, Serialize_tuple, Deserialize_tuple)]
320297
pub struct PreCommitSectorBatchParams2 {
321298
pub sectors: Vec<SectorPreCommitInfo>,
322299
}
323300

324-
impl Cbor for PreCommitSectorBatchParams2 {}
325-
326301
#[derive(Debug, Default, PartialEq, Eq, Clone, Serialize_tuple, Deserialize_tuple)]
327302
pub struct SectorPreCommitInfo {
328303
pub seal_proof: RegisteredSealProof,
@@ -392,16 +367,12 @@ pub struct ApplyRewardParams {
392367
pub penalty: TokenAmount,
393368
}
394369

395-
impl Cbor for DisputeWindowedPoStParams {}
396-
397370
#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize_tuple, Deserialize_tuple)]
398371
pub struct DisputeWindowedPoStParams {
399372
pub deadline: u64,
400373
pub post_index: u64, // only one is allowed at a time to avoid loading too many sector infos.
401374
}
402375

403-
impl Cbor for ProveCommitAggregateParams {}
404-
405376
#[derive(Debug, Serialize_tuple, Deserialize_tuple)]
406377
pub struct ProveCommitAggregateParams {
407378
pub sector_numbers: BitField,
@@ -426,8 +397,6 @@ pub struct ProveReplicaUpdatesParams {
426397
pub updates: Vec<ReplicaUpdate>,
427398
}
428399

429-
impl Cbor for ProveReplicaUpdatesParams {}
430-
431400
#[derive(Debug, PartialEq, Eq, Serialize_tuple, Deserialize_tuple)]
432401
pub struct ReplicaUpdate2 {
433402
pub sector_number: SectorNumber,
@@ -446,8 +415,6 @@ pub struct ProveReplicaUpdatesParams2 {
446415
pub updates: Vec<ReplicaUpdate2>,
447416
}
448417

449-
impl Cbor for ProveReplicaUpdatesParams2 {}
450-
451418
#[derive(Debug, Clone, Serialize_tuple, Deserialize_tuple)]
452419
pub struct ChangeBeneficiaryParams {
453420
pub new_beneficiary: Address,
@@ -465,20 +432,14 @@ impl ChangeBeneficiaryParams {
465432
}
466433
}
467434

468-
impl Cbor for ChangeBeneficiaryParams {}
469-
470435
#[derive(Debug, Serialize_tuple, Deserialize_tuple)]
471436
pub struct ActiveBeneficiary {
472437
pub beneficiary: Address,
473438
pub term: BeneficiaryTerm,
474439
}
475440

476-
impl Cbor for ActiveBeneficiary {}
477-
478441
#[derive(Debug, Serialize_tuple, Deserialize_tuple)]
479442
pub struct GetBeneficiaryReturn {
480443
pub active: ActiveBeneficiary,
481444
pub proposed: Option<PendingBeneficiaryChange>,
482445
}
483-
484-
impl Cbor for GetBeneficiaryReturn {}

actors/miner/tests/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ impl ActorHarness {
626626
rt: &mut MockRuntime,
627627
sectors: &[SectorPreCommitInfo],
628628
method: MethodNum,
629-
param: impl Cbor,
629+
param: impl Serialize,
630630
first_for_miner: bool,
631631
base_fee: &TokenAmount,
632632
) -> Result<RawBytes, ActorError> {

actors/multisig/src/types.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::fmt::Display;
55

66
use fvm_ipld_encoding::tuple::*;
7-
use fvm_ipld_encoding::{serde_bytes, Cbor, RawBytes};
7+
use fvm_ipld_encoding::{serde_bytes, RawBytes};
88
use fvm_ipld_hamt::BytesKey;
99
use fvm_shared::address::Address;
1010

@@ -96,9 +96,6 @@ pub struct ProposeReturn {
9696
pub ret: RawBytes,
9797
}
9898

99-
impl Cbor for ProposeParams {}
100-
impl Cbor for ProposeReturn {}
101-
10299
/// Parameters for approve and cancel multisig functions.
103100
#[derive(Clone, PartialEq, Eq, Debug, Serialize_tuple, Deserialize_tuple)]
104101
pub struct TxnIDParams {
@@ -122,9 +119,6 @@ pub struct ApproveReturn {
122119
pub ret: RawBytes,
123120
}
124121

125-
impl Cbor for TxnIDParams {}
126-
impl Cbor for ApproveReturn {}
127-
128122
/// Add signer params.
129123
#[derive(Serialize_tuple, Deserialize_tuple)]
130124
pub struct AddSignerParams {
@@ -139,17 +133,13 @@ pub struct RemoveSignerParams {
139133
pub decrease: bool,
140134
}
141135

142-
impl Cbor for RemoveSignerParams {}
143-
144136
/// Swap signer multisig method params
145137
#[derive(Serialize_tuple, Deserialize_tuple)]
146138
pub struct SwapSignerParams {
147139
pub from: Address,
148140
pub to: Address,
149141
}
150142

151-
impl Cbor for SwapSignerParams {}
152-
153143
/// Propose method call parameters
154144
#[derive(Serialize_tuple, Deserialize_tuple)]
155145
pub struct ChangeNumApprovalsThresholdParams {

actors/power/src/types.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0, MIT
33

44
use fvm_ipld_encoding::tuple::*;
5-
use fvm_ipld_encoding::{serde_bytes, BytesDe, Cbor, RawBytes};
5+
use fvm_ipld_encoding::{serde_bytes, BytesDe, RawBytes};
66
use fvm_shared::address::Address;
77
use fvm_shared::bigint::bigint_ser;
88
use fvm_shared::clock::ChainEpoch;
@@ -32,7 +32,6 @@ pub struct CreateMinerParams {
3232
pub peer: Vec<u8>,
3333
pub multiaddrs: Vec<BytesDe>,
3434
}
35-
impl Cbor for CreateMinerParams {}
3635

3736
#[derive(Serialize_tuple, Deserialize_tuple)]
3837
pub struct CreateMinerReturn {

0 commit comments

Comments
 (0)