Skip to content

Commit 1c9029f

Browse files
committed
feat: change canary
1 parent 658bb14 commit 1c9029f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/fill/traits.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,40 @@ mod test {
230230
*chain_id = 1;
231231
}
232232
}
233+
234+
// This test exists to ensure that if fields are added to BlockEnv or TxEnv,
235+
// the compiler will emit an error to remind us to update the fillers to
236+
// handle the new fields. The change canary is not present for [`CfgEnv`]
237+
// because it is marked `#[non_exhaustive]`, which prevents compiler errors
238+
// when fields are added. This is moderately annoying.
239+
#[allow(unused_variables)]
240+
fn _change_canary(block: &BlockEnv, tx: &TxEnv) {
241+
let BlockEnv {
242+
number,
243+
beneficiary,
244+
timestamp,
245+
gas_limit,
246+
basefee,
247+
difficulty,
248+
prevrandao,
249+
blob_excess_gas_and_price,
250+
} = block;
251+
252+
let TxEnv {
253+
tx_type,
254+
caller,
255+
gas_limit,
256+
gas_price,
257+
kind,
258+
value,
259+
data,
260+
nonce,
261+
chain_id,
262+
access_list,
263+
gas_priority_fee,
264+
blob_hashes,
265+
max_fee_per_blob_gas,
266+
authorization_list,
267+
} = tx;
268+
}
233269
}

0 commit comments

Comments
 (0)