File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,12 @@ pub struct AccessListInspector {
20
20
access_list : HashMap < Address , BTreeSet < B256 > > ,
21
21
}
22
22
23
+ impl From < AccessList > for AccessListInspector {
24
+ fn from ( access_list : AccessList ) -> Self {
25
+ Self :: new ( access_list)
26
+ }
27
+ }
28
+
23
29
impl AccessListInspector {
24
30
/// Creates a new inspector instance
25
31
///
@@ -55,14 +61,18 @@ impl AccessListInspector {
55
61
AccessList ( items. collect ( ) )
56
62
}
57
63
58
- /// Collects addresses which should be excluded from the access list.
64
+ /// Collects addresses which should be excluded from the access list. Must be called before the
65
+ /// top-level call.
59
66
///
60
67
/// Those include caller, callee and precompiles.
61
68
fn collect_excluded_addresses < DB : Database > ( & mut self , context : & EvmContext < DB > ) {
62
69
let from = context. env . tx . caller ;
63
70
let to = if let TxKind :: Call ( to) = context. env . tx . transact_to {
64
71
to
65
72
} else {
73
+ // We need to exclude the created address if this is a CREATE frame.
74
+ //
75
+ // This assumes that caller has already been loaded but nonce was not increased yet.
66
76
let nonce = context. journaled_state . account ( from) . info . nonce ;
67
77
from. create ( nonce)
68
78
} ;
You can’t perform that action at this time.
0 commit comments