1
+ use alloy_eip2930:: AccessList ;
2
+ use alloy_eip7702:: SignedAuthorization ;
1
3
use context_interface:: transaction:: AuthorizationItem ;
2
4
use context_interface:: Transaction ;
3
5
use core:: fmt:: Debug ;
@@ -39,7 +41,7 @@ pub struct TxEnv {
39
41
/// Added in [EIP-2930].
40
42
///
41
43
/// [EIP-2930]: https://eips.ethereum.org/EIPS/eip-2930
42
- pub access_list : Vec < ( Address , Vec < B256 > ) > ,
44
+ pub access_list : AccessList ,
43
45
44
46
/// The priority fee per gas
45
47
///
@@ -72,7 +74,7 @@ pub struct TxEnv {
72
74
/// Set EOA account code for one transaction via [EIP-7702].
73
75
///
74
76
/// [EIP-7702]: https://eips.ethereum.org/EIPS/eip-7702
75
- pub authorization_list : Vec < AuthorizationItem > ,
77
+ pub authorization_list : Vec < SignedAuthorization > ,
76
78
}
77
79
78
80
impl Default for TxEnv {
@@ -87,7 +89,7 @@ impl Default for TxEnv {
87
89
data : Bytes :: default ( ) ,
88
90
nonce : 0 ,
89
91
chain_id : Some ( 1 ) , // Mainnet chain ID is 1
90
- access_list : Vec :: new ( ) ,
92
+ access_list : Default :: default ( ) ,
91
93
gas_priority_fee : Some ( 0 ) ,
92
94
blob_hashes : Vec :: new ( ) ,
93
95
max_fee_per_blob_gas : 0 ,
@@ -132,8 +134,9 @@ impl Transaction for TxEnv {
132
134
fn access_list ( & self ) -> Option < impl Iterator < Item = ( & Address , & [ B256 ] ) > > {
133
135
Some (
134
136
self . access_list
137
+ . 0
135
138
. iter ( )
136
- . map ( |( address , storage_keys ) | ( address, storage_keys. as_slice ( ) ) ) ,
139
+ . map ( |item | ( & item . address , item . storage_keys . as_slice ( ) ) ) ,
137
140
)
138
141
}
139
142
@@ -150,7 +153,14 @@ impl Transaction for TxEnv {
150
153
}
151
154
152
155
fn authorization_list ( & self ) -> impl Iterator < Item = AuthorizationItem > {
153
- self . authorization_list . iter ( ) . cloned ( )
156
+ self . authorization_list . iter ( ) . map ( |item| {
157
+ (
158
+ item. recover_authority ( ) . ok ( ) ,
159
+ item. chain_id ,
160
+ item. nonce ,
161
+ item. address ,
162
+ )
163
+ } )
154
164
}
155
165
156
166
fn input ( & self ) -> & Bytes {
0 commit comments