Skip to content

Commit 04f5246

Browse files
committed
chore: ckb-gen-type-migrate
1 parent 4d6ed51 commit 04f5246

File tree

10 files changed

+99
-99
lines changed

10 files changed

+99
-99
lines changed

src/test_util.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl Context {
129129
{
130130
let cell_dep = CellDep::new_builder()
131131
.out_point(OutPoint::new(tx.hash(), idx as u32))
132-
.dep_type(DepType::Code.into())
132+
.dep_type(DepType::Code)
133133
.build();
134134
ctx.add_cell_dep(cell_dep, output, data.raw_data(), Some(block_hash.clone()));
135135
}
@@ -146,7 +146,7 @@ impl Context {
146146
let group_out_point = ctx.deploy_cell(out_points.as_bytes());
147147
let cell_dep = CellDep::new_builder()
148148
.out_point(group_out_point)
149-
.dep_type(DepType::DepGroup.into())
149+
.dep_type(DepType::DepGroup)
150150
.build();
151151
let script_id = ScriptId::new_data1(data_hash);
152152
ctx.add_cell_dep_map(script_id, cell_dep);
@@ -204,7 +204,7 @@ impl Context {
204204
.as_u64()
205205
});
206206
let output = CellOutput::new_builder()
207-
.capacity(capacity.pack())
207+
.capacity(capacity)
208208
.lock(lock_script)
209209
.build();
210210
self.add_live_cell(input, output, Bytes::default(), None)
@@ -216,7 +216,7 @@ impl Context {
216216
let out_point = random_out_point();
217217
let cell_dep = CellDep::new_builder()
218218
.out_point(out_point.clone())
219-
.dep_type(DepType::Code.into())
219+
.dep_type(DepType::Code)
220220
.build();
221221
let output = CellOutput::default();
222222
self.add_cell_dep(cell_dep, output, data, None);
@@ -374,7 +374,7 @@ impl Context {
374374
ckb2023: CKB2023::new_dev_default(),
375375
})
376376
.build();
377-
let tip = HeaderBuilder::default().number(0.pack()).build();
377+
let tip = HeaderBuilder::default().number(0).build();
378378
let tx_verify_env = TxVerifyEnv::new_submit(&tip);
379379

380380
let verifier = TransactionScriptsVerifier::new(

src/tests/ckb_indexer_rpc.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn test_cells_search_mode_default_partitial() {
3737
// default with partitial args
3838
let script = ckb_types::packed::Script::new_builder()
3939
.code_hash(CODE_HASH.pack())
40-
.hash_type(ScriptHashType::Type.into())
40+
.hash_type(ScriptHashType::Type)
4141
.args(ARGS[0..2].pack())
4242
.build();
4343

@@ -60,7 +60,7 @@ fn test_cells_search_mode_prefix_partitial() {
6060
// prefix with partitial args
6161
let script = ckb_types::packed::Script::new_builder()
6262
.code_hash(CODE_HASH.pack())
63-
.hash_type(ScriptHashType::Type.into())
63+
.hash_type(ScriptHashType::Type)
6464
.args(ARGS[0..2].pack())
6565
.build();
6666

@@ -82,7 +82,7 @@ fn test_cells_search_mode_exact_partitial() {
8282
let block_range = Some(ValueRangeOption::new(0, 1));
8383
let script = ckb_types::packed::Script::new_builder()
8484
.code_hash(CODE_HASH.pack())
85-
.hash_type(ScriptHashType::Type.into())
85+
.hash_type(ScriptHashType::Type)
8686
.args(ARGS[0..2].pack())
8787
.build();
8888
// exact with partitial args
@@ -104,7 +104,7 @@ fn test_cells_search_mode_exact() {
104104
let block_range = Some(ValueRangeOption::new(0, 1));
105105
let script = ckb_types::packed::Script::new_builder()
106106
.code_hash(CODE_HASH.pack())
107-
.hash_type(ScriptHashType::Type.into())
107+
.hash_type(ScriptHashType::Type)
108108
.args(ARGS[..].pack())
109109
.build();
110110

@@ -127,7 +127,7 @@ fn test_get_transactions_search_mode_default() {
127127
let block_range = Some(ValueRangeOption::new(0, 1));
128128
let script = ckb_types::packed::Script::new_builder()
129129
.code_hash(CODE_HASH.pack())
130-
.hash_type(ScriptHashType::Type.into())
130+
.hash_type(ScriptHashType::Type)
131131
.args(ARGS[0..2].pack())
132132
.build();
133133

@@ -150,7 +150,7 @@ fn test_get_transactions_search_mode_prefix_partial() {
150150
let block_range = Some(ValueRangeOption::new(0, 1));
151151
let script = ckb_types::packed::Script::new_builder()
152152
.code_hash(CODE_HASH.pack())
153-
.hash_type(ScriptHashType::Type.into())
153+
.hash_type(ScriptHashType::Type)
154154
.args(ARGS[0..2].pack())
155155
.build();
156156

@@ -172,7 +172,7 @@ fn test_get_transactions_search_mode_exact_partitial() {
172172
let block_range = Some(ValueRangeOption::new(0, 1));
173173
let script = ckb_types::packed::Script::new_builder()
174174
.code_hash(CODE_HASH.pack())
175-
.hash_type(ScriptHashType::Type.into())
175+
.hash_type(ScriptHashType::Type)
176176
.args(ARGS[0..2].pack())
177177
.build();
178178

@@ -195,7 +195,7 @@ fn test_get_transactions_search_mode_exact_full() {
195195
// exact search
196196
let script = ckb_types::packed::Script::new_builder()
197197
.code_hash(CODE_HASH.pack())
198-
.hash_type(ScriptHashType::Type.into())
198+
.hash_type(ScriptHashType::Type)
199199
.args(ARGS[..].pack())
200200
.build();
201201

@@ -217,7 +217,7 @@ fn test_get_cells_capacity_search_mode_default() {
217217
let block_range = Some(ValueRangeOption::new(0, 1));
218218
let script = ckb_types::packed::Script::new_builder()
219219
.code_hash(CODE_HASH.pack())
220-
.hash_type(ScriptHashType::Type.into())
220+
.hash_type(ScriptHashType::Type)
221221
.args(ARGS[0..2].pack())
222222
.build();
223223

@@ -238,7 +238,7 @@ fn test_get_cells_capacity_search_mode_prefix_partial() {
238238
let block_range = Some(ValueRangeOption::new(0, 1));
239239
let script = ckb_types::packed::Script::new_builder()
240240
.code_hash(CODE_HASH.pack())
241-
.hash_type(ScriptHashType::Type.into())
241+
.hash_type(ScriptHashType::Type)
242242
.args(ARGS[0..2].pack())
243243
.build();
244244

@@ -259,7 +259,7 @@ fn test_get_cells_capacity_search_mode_exact_partital() {
259259
let block_range = Some(ValueRangeOption::new(0, 1));
260260
let script = ckb_types::packed::Script::new_builder()
261261
.code_hash(CODE_HASH.pack())
262-
.hash_type(ScriptHashType::Type.into())
262+
.hash_type(ScriptHashType::Type)
263263
.args(ARGS[0..2].pack())
264264
.build();
265265
// exact with partitial args
@@ -280,7 +280,7 @@ fn test_get_cells_capacity_search_mode_exact() {
280280
let block_range = Some(ValueRangeOption::new(0, 1));
281281
let script = ckb_types::packed::Script::new_builder()
282282
.code_hash(CODE_HASH.pack())
283-
.hash_type(ScriptHashType::Type.into())
283+
.hash_type(ScriptHashType::Type)
284284
.args(ARGS[..].pack())
285285
.build();
286286

src/tests/cycle.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn build_script(loops: u64) -> Script {
7171
let cycle_data_hash = H256::from(blake2b_256(CYCLE_BIN));
7272
Script::new_builder()
7373
.code_hash(cycle_data_hash.pack())
74-
.hash_type(ScriptHashType::Data.into())
74+
.hash_type(ScriptHashType::Data)
7575
.args(build_args(loops).pack())
7676
.build()
7777
}
@@ -107,7 +107,7 @@ fn test_change_enough(loops: u64) {
107107
)));
108108

109109
let output = CellOutput::new_builder()
110-
.capacity((140 * ONE_CKB).pack())
110+
.capacity(140 * ONE_CKB)
111111
.lock(receiver)
112112
.build();
113113
let builder = CapacityTransferBuilder::new(vec![(output.clone(), Bytes::default())]);
@@ -153,7 +153,7 @@ fn vsize_big_and_fee_enough() {
153153
)));
154154

155155
let output = CellOutput::new_builder()
156-
.capacity((200 * ONE_CKB).pack())
156+
.capacity(200 * ONE_CKB)
157157
.lock(receiver)
158158
.build();
159159
let builder = CapacityTransferBuilder::new(vec![(output.clone(), Bytes::default())]);
@@ -199,7 +199,7 @@ fn vsize_big_and_fee_not_enough() {
199199
)));
200200

201201
let output = CellOutput::new_builder()
202-
.capacity((200 * ONE_CKB).pack())
202+
.capacity(200 * ONE_CKB)
203203
.lock(receiver)
204204
.build();
205205
let builder = CapacityTransferBuilder::new(vec![(output, Bytes::default())]);
@@ -235,7 +235,7 @@ fn vsize_big_and_can_find_more_capacity() {
235235
)));
236236

237237
let output = CellOutput::new_builder()
238-
.capacity((200 * ONE_CKB).pack())
238+
.capacity(200 * ONE_CKB)
239239
.lock(receiver)
240240
.build();
241241
let builder = CapacityTransferBuilder::new(vec![(output.clone(), Bytes::default())]);
@@ -325,7 +325,7 @@ fn vsize_big_and_cannot_find_more_capacity() {
325325
)));
326326

327327
let output = CellOutput::new_builder()
328-
.capacity((200 * ONE_CKB).pack())
328+
.capacity(200 * ONE_CKB)
329329
.lock(receiver)
330330
.build();
331331
let builder = CapacityTransferBuilder::new(vec![(output, Bytes::default())]);

0 commit comments

Comments
 (0)