Skip to content

Commit

Permalink
match input field before data field
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois committed Jun 24, 2024
1 parent 3255080 commit 7837a6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions node/service/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ impl fc_rpc::EstimateGasAdapter for MoonbeamEGA {
));
const BATCH_PRECOMPILE_BATCH_ALL_SELECTOR: [u8; 4] = hex_literal::hex!("96e292b8");
if request.to == Some(BATCH_PRECOMPILE_ADDRESS) {
match (&mut request.data.data, &mut request.data.input) {
(Some(ref mut input), _) => {
if input.0.len() >= 4 {
input.0[..4].copy_from_slice(&BATCH_PRECOMPILE_BATCH_ALL_SELECTOR);
}
}
match (&mut request.data.input, &mut request.data.data) {
(None, Some(ref mut data)) => {
if data.0.len() >= 4 {
data.0[..4].copy_from_slice(&BATCH_PRECOMPILE_BATCH_ALL_SELECTOR);
}
}
(Some(ref mut input), _) => {
if input.0.len() >= 4 {
input.0[..4].copy_from_slice(&BATCH_PRECOMPILE_BATCH_ALL_SELECTOR);
}
}
(_, _) => {}
};
}
Expand Down

0 comments on commit 7837a6c

Please sign in to comment.