@@ -57,7 +57,7 @@ fn fmt_err<F: ::std::fmt::Display>(f: F) -> String {
57
57
58
58
/// Parameters common to ethereum-like blockchains.
59
59
/// NOTE: when adding bugfix hard-fork parameters,
60
- /// add to `contains_bugfix_hard_fork `
60
+ /// add to `nonzero_bugfix_hard_fork `
61
61
///
62
62
/// we define a "bugfix" hard fork as any hard fork which
63
63
/// you would put on-by-default in a new chain.
@@ -188,13 +188,21 @@ impl CommonParams {
188
188
}
189
189
}
190
190
191
- /// Whether these params contain any bug-fix hard forks.
192
- pub fn contains_bugfix_hard_fork ( & self ) -> bool {
193
- self . eip98_transition != 0 && self . eip155_transition != 0 &&
194
- self . validate_receipts_transition != 0 && self . eip86_transition != 0 &&
195
- self . eip140_transition != 0 && self . eip210_transition != 0 &&
196
- self . eip211_transition != 0 && self . eip214_transition != 0 &&
197
- self . validate_chain_id_transition != 0 && self . dust_protection_transition != 0
191
+ /// Return Some if the current parameters contain a bugfix hard fork not on block 0.
192
+ pub fn nonzero_bugfix_hard_fork ( & self ) -> Option < & str > {
193
+ if self . eip155_transition != 0 {
194
+ return Some ( "eip155Transition" ) ;
195
+ }
196
+
197
+ if self . validate_receipts_transition != 0 {
198
+ return Some ( "validateReceiptsTransition" ) ;
199
+ }
200
+
201
+ if self . validate_chain_id_transition != 0 {
202
+ return Some ( "validateChainIdTransition" ) ;
203
+ }
204
+
205
+ None
198
206
}
199
207
}
200
208
0 commit comments