Skip to content

Commit 9ee8ce5

Browse files
committed
Execute ckb-gen-type-migrate --cargo
1 parent 628578d commit 9ee8ce5

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

light-client-bin/src/tests/service.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ fn get_cells_capacity_bug() {
10751075
// setup test data
10761076
let lock_script1 = ScriptBuilder::default()
10771077
.code_hash(H256(rand::random()).pack())
1078-
.hash_type(ScriptHashType::Data.into())
1078+
.hash_type(ScriptHashType::Data)
10791079
.args(Bytes::from(b"lock_script1".to_vec()).pack())
10801080
.build();
10811081

@@ -1101,7 +1101,7 @@ fn get_cells_capacity_bug() {
11011101
.header(
11021102
HeaderBuilder::default()
11031103
.epoch(EpochNumberWithFraction::new(0, 0, 1000).pack())
1104-
.number(0.pack())
1104+
.number(0)
11051105
.build(),
11061106
)
11071107
.build();
@@ -1117,7 +1117,7 @@ fn get_cells_capacity_bug() {
11171117

11181118
let lock_script2 = ScriptBuilder::default()
11191119
.code_hash(H256(rand::random()).pack())
1120-
.hash_type(ScriptHashType::Data.into())
1120+
.hash_type(ScriptHashType::Data)
11211121
.args(Bytes::from(b"lock_script2".to_vec()).pack())
11221122
.build();
11231123

@@ -1143,7 +1143,7 @@ fn get_cells_capacity_bug() {
11431143
.header(
11441144
HeaderBuilder::default()
11451145
.epoch(EpochNumberWithFraction::new(0, 1, 1000).pack())
1146-
.number(1.pack())
1146+
.number(1)
11471147
.build(),
11481148
)
11491149
.build();
@@ -1173,7 +1173,7 @@ fn get_cells_capacity_bug() {
11731173
.header(
11741174
HeaderBuilder::default()
11751175
.epoch(EpochNumberWithFraction::new(0, 2, 1000).pack())
1176-
.number(2.pack())
1176+
.number(2)
11771177
.build(),
11781178
)
11791179
.build();
@@ -1200,13 +1200,13 @@ fn get_cells_after_rollback_bug() {
12001200
// setup test data
12011201
let lock_script1 = ScriptBuilder::default()
12021202
.code_hash(H256(rand::random()).pack())
1203-
.hash_type(ScriptHashType::Data.into())
1203+
.hash_type(ScriptHashType::Data)
12041204
.args(Bytes::from(b"lock_script1".to_vec()).pack())
12051205
.build();
12061206

12071207
let lock_script2 = ScriptBuilder::default()
12081208
.code_hash(H256(rand::random()).pack())
1209-
.hash_type(ScriptHashType::Data.into())
1209+
.hash_type(ScriptHashType::Data)
12101210
.args(Bytes::from(b"lock_script2".to_vec()).pack())
12111211
.build();
12121212

@@ -1232,7 +1232,7 @@ fn get_cells_after_rollback_bug() {
12321232
.header(
12331233
HeaderBuilder::default()
12341234
.epoch(EpochNumberWithFraction::new(0, 0, 1000).pack())
1235-
.number(0.pack())
1235+
.number(0)
12361236
.build(),
12371237
)
12381238
.build();
@@ -1275,7 +1275,7 @@ fn get_cells_after_rollback_bug() {
12751275
.header(
12761276
HeaderBuilder::default()
12771277
.epoch(EpochNumberWithFraction::new(0, 1, 1000).pack())
1278-
.number(1.pack())
1278+
.number(1)
12791279
.build(),
12801280
)
12811281
.build();
@@ -1306,7 +1306,7 @@ fn get_cells_after_rollback_bug() {
13061306
.header(
13071307
HeaderBuilder::default()
13081308
.epoch(EpochNumberWithFraction::new(0, 2, 1000).pack())
1309-
.number(2.pack())
1309+
.number(2)
13101310
.build(),
13111311
)
13121312
.build();
@@ -1627,13 +1627,13 @@ fn test_chain_txs_in_same_block_bug() {
16271627
// setup test data
16281628
let lock_script1 = ScriptBuilder::default()
16291629
.code_hash(H256(rand::random()).pack())
1630-
.hash_type(ScriptHashType::Data.into())
1630+
.hash_type(ScriptHashType::Data)
16311631
.args(Bytes::from(b"lock_script1".to_vec()).pack())
16321632
.build();
16331633

16341634
let lock_script2 = ScriptBuilder::default()
16351635
.code_hash(H256(rand::random()).pack())
1636-
.hash_type(ScriptHashType::Data.into())
1636+
.hash_type(ScriptHashType::Data)
16371637
.args(Bytes::from(b"lock_script2".to_vec()).pack())
16381638
.build();
16391639

@@ -1659,7 +1659,7 @@ fn test_chain_txs_in_same_block_bug() {
16591659
.header(
16601660
HeaderBuilder::default()
16611661
.epoch(EpochNumberWithFraction::new(0, 0, 1000).pack())
1662-
.number(0.pack())
1662+
.number(0)
16631663
.build(),
16641664
)
16651665
.build();
@@ -1707,7 +1707,7 @@ fn test_chain_txs_in_same_block_bug() {
17071707
.header(
17081708
HeaderBuilder::default()
17091709
.epoch(EpochNumberWithFraction::new(0, 1, 1000).pack())
1710-
.number(1.pack())
1710+
.number(1)
17111711
.build(),
17121712
)
17131713
.build();

light-client-lib/src/protocols/filter/block_filter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl FilterProtocol {
268268
start_number
269269
);
270270
let content = packed::GetBlockFilters::new_builder()
271-
.start_number(start_number.pack())
271+
.start_number(start_number)
272272
.build();
273273
let message = packed::BlockFilterMessage::new_builder()
274274
.set(content)
@@ -291,7 +291,7 @@ impl FilterProtocol {
291291
start_number
292292
);
293293
let content = packed::GetBlockFilterHashes::new_builder()
294-
.start_number(start_number.pack())
294+
.start_number(start_number)
295295
.build();
296296
let message = packed::BlockFilterMessage::new_builder()
297297
.set(content)
@@ -314,7 +314,7 @@ impl FilterProtocol {
314314
start_number
315315
);
316316
let content = packed::GetBlockFilterCheckPoints::new_builder()
317-
.start_number(start_number.pack())
317+
.start_number(start_number)
318318
.build();
319319
let message = packed::BlockFilterMessage::new_builder()
320320
.set(content)

light-client-lib/src/protocols/light_client/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ impl LightClientProtocol {
863863

864864
builder
865865
.start_hash(real_start_hash)
866-
.start_number(real_start_number.pack())
866+
.start_number(real_start_number)
867867
.difficulty_boundary(start_total_difficulty.pack())
868868
} else {
869869
let (difficulty_boundary, difficulties) = sampling::sample_blocks(
@@ -875,7 +875,7 @@ impl LightClientProtocol {
875875
);
876876
builder
877877
.start_hash(start_hash)
878-
.start_number(start_number.pack())
878+
.start_number(start_number)
879879
.difficulty_boundary(difficulty_boundary.pack())
880880
.difficulties(difficulties.into_iter().map(|inner| inner.pack()).pack())
881881
}
@@ -900,8 +900,8 @@ impl LightClientProtocol {
900900
let builder = packed::GetLastStateProof::new_builder()
901901
.last_hash(last_header.header().hash())
902902
.start_hash(start_hash)
903-
.start_number(start_number.pack())
904-
.last_n_blocks(last_n_blocks.pack());
903+
.start_number(start_number)
904+
.last_n_blocks(last_n_blocks);
905905
let content = if last_number - start_number <= last_n_blocks {
906906
builder.difficulty_boundary(start_total_difficulty.pack())
907907
} else {

light-client-lib/src/protocols/relayer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl CKBProtocolHandler for RelayProtocol {
205205
.map(|(tx, cycles, _)| {
206206
packed::RelayTransaction::new_builder()
207207
.transaction(tx)
208-
.cycles(cycles.pack())
208+
.cycles(cycles)
209209
.build()
210210
})
211211
})

0 commit comments

Comments
 (0)