You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let data_hex = "0x02f871015585037d46c34985037d46c34983027d0594e68df8dc3931aaab2077c57bbd2cbcedd17fcfce808457386225c080a0ac97a4d2f460d238fddaaed992047547d04c17ae454d6219a3a96699115ffcf5a006c2d3bd79f9b3321438721609ff6dddb0e50b8d9e38d02b68456590c33dee47";
@@ -290,7 +288,7 @@ mod test {
290
288
let tx = Transaction::decode(&data)?;
291
289
292
290
let encoded = Transaction::encode(&tx)?;
293
-
let encoded_hex = format!("0x{}",hex::encode(&encoded));
291
+
let encoded_hex = format!("0x{}",hex::encode(&encoded));
294
292
295
293
assert_eq!(data, encoded);
296
294
assert_eq!(data_hex,&encoded_hex);
@@ -299,8 +297,6 @@ mod test {
299
297
}
300
298
}
301
299
302
-
303
-
304
300
// pub struct Transaction2930 {
305
301
// pub chain_id: u64,
306
302
// pub nonce: u64,
@@ -314,198 +310,3 @@ mod test {
314
310
// pub r: String,
315
311
// pub s: String,
316
312
// }
317
-
318
-
// impl From<(Vec<u8>, u64)> for TransactionLegacy {
319
-
// fn from(data: (Vec<u8>, u64)) -> Self {
320
-
// let rlp = rlp::Rlp::new(&data.0[..]);
321
-
322
-
// let nonce_hex = rlp.at(0).as_val::<Vec<u8>>();
323
-
// let nonce = vec_u8_to_u64(&nonce_hex);
324
-
325
-
// let gas_price_hex = rlp.at(1).as_val::<Vec<u8>>();
326
-
// let gas_price = vec_u8_to_u64(&gas_price_hex);
327
-
328
-
// let gas_limit_hex = rlp.at(2).as_val::<Vec<u8>>();
329
-
// let gas_limit = vec_u8_to_u64(&gas_limit_hex);
330
-
331
-
// let to_hex = rlp.at(3).as_val::<Vec<u8>>();
332
-
// let to = vec_u8_to_string(&to_hex);
333
-
334
-
// let value_hex = rlp.at(4).as_val::<Vec<u8>>();
335
-
// let value = vec_u8_to_u64(&value_hex);
336
-
337
-
// let data_tx_hex = rlp.at(5).as_val::<Vec<u8>>();
338
-
// let data_tx = vec_u8_to_string(&data_tx_hex);
339
-
340
-
// let v_hex = rlp.at(6).as_val::<Vec<u8>>();
341
-
// let v = vec_u8_to_string(&v_hex);
342
-
343
-
// let r_hex = rlp.at(7).as_val::<Vec<u8>>();
344
-
// let r = vec_u8_to_string(&r_hex);
345
-
346
-
// let s_hex = rlp.at(8).as_val::<Vec<u8>>();
347
-
// let s = vec_u8_to_string(&s_hex);
348
-
349
-
// let chain_id =data.1;
350
-
351
-
// TransactionLegacy {
352
-
// chain_id,
353
-
// nonce,
354
-
// gas_price,
355
-
// gas_limit,
356
-
// to,
357
-
// value,
358
-
// data: data_tx,
359
-
// v,
360
-
// r,
361
-
// s,
362
-
// }
363
-
// }
364
-
// }
365
-
366
-
// impl From<Vec<u8>> for Transaction2930 {
367
-
// fn from(data: Vec<u8>) -> Self {
368
-
// let rlp = rlp::Rlp::new(&data[1..]);
369
-
370
-
// let chain_id_hex = rlp.at(0).as_val::<Vec<u8>>();
371
-
// let chain_id = vec_u8_to_u64(&chain_id_hex);
372
-
373
-
// let nonce_hex = rlp.at(1).as_val::<Vec<u8>>();
374
-
// let nonce = vec_u8_to_u64(&nonce_hex);
375
-
376
-
// let gas_price_hex = rlp.at(2).as_val::<Vec<u8>>();
377
-
// let gas_price = vec_u8_to_u64(&gas_price_hex);
378
-
379
-
// let gas_limit_hex = rlp.at(3).as_val::<Vec<u8>>();
380
-
// let gas_limit = vec_u8_to_u64(&gas_limit_hex);
381
-
382
-
// let to_hex = rlp.at(4).as_val::<Vec<u8>>();
383
-
// let to = vec_u8_to_string(&to_hex);
384
-
385
-
// let value_hex = rlp.at(5).as_val::<Vec<u8>>();
386
-
// let value = vec_u8_to_u64(&value_hex);
387
-
388
-
// let data_tx_hex = rlp.at(6).as_val::<Vec<u8>>();
389
-
// let data_tx = vec_u8_to_string(&data_tx_hex);
390
-
391
-
// let access_list = decode_access_list(&rlp.at(7).as_raw().to_vec());
392
-
393
-
// let v_hex = rlp.at(8).as_val::<Vec<u8>>();
394
-
// let v = vec_u8_to_string(&v_hex);
395
-
396
-
// let r_hex = rlp.at(9).as_val::<Vec<u8>>();
397
-
// let r = vec_u8_to_string(&r_hex);
398
-
399
-
// let s_hex = rlp.at(10).as_val::<Vec<u8>>();
400
-
// let s = vec_u8_to_string(&s_hex);
401
-
// Transaction2930 {
402
-
// chain_id,
403
-
// nonce,
404
-
// gas_price,
405
-
// gas_limit,
406
-
// to,
407
-
// data: data_tx,
408
-
// value,
409
-
// access_list,
410
-
// v,
411
-
// r,
412
-
// s,
413
-
// }
414
-
415
-
// }
416
-
// }
417
-
418
-
// impl From<Vec<u8>> for Transaction1559 {
419
-
// fn from(data: Vec<u8>) -> Self {
420
-
// let rlp = rlp::Rlp::new(&data[1..]);
421
-
422
-
// // let chain_id_hex = rlp.at(0).as_val::<Vec<u8>>();
423
-
// // let chain_id = vec_u8_to_u64(&chain_id_hex);
424
-
425
-
// // let nonce_hex = rlp.at(1).as_val::<Vec<u8>>();
426
-
// // let nonce = vec_u8_to_u64(&nonce_hex);
427
-
428
-
// // let max_priority_fee_per_gas_hex = rlp.at(2).as_val::<Vec<u8>>();
429
-
// // let max_priority_fee_per_gas = vec_u8_to_u64(&max_priority_fee_per_gas_hex);
430
-
431
-
// // let max_fee_per_gas_hex = rlp.at(3).as_val::<Vec<u8>>();
432
-
433
-
// // let max_fee_per_gas = vec_u8_to_u64(&max_fee_per_gas_hex);
434
-
435
-
// // let gas_limit_hex = rlp.at(4).as_val::<Vec<u8>>();
436
-
// // let gas_limit = vec_u8_to_u64(&gas_limit_hex);
437
-
438
-
// // let to_hex = rlp.at(5).as_val::<Vec<u8>>();
439
-
// // let to = vec_u8_to_string(&to_hex);
440
-
441
-
// // let value_hex = rlp.at(6).as_val::<Vec<u8>>();
442
-
// // let value = vec_u8_to_u64(&value_hex);
443
-
444
-
// // let data_tx_hex = rlp.at(7).as_val::<Vec<u8>>();
445
-
// // let data_tx = vec_u8_to_string(&data_tx_hex);
446
-
447
-
// // let access_list = decode_access_list(&rlp.at(8).as_raw().to_vec());
0 commit comments