-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(cast): improve handling of mktx --raw-unsigned
with runtime validation
#11111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
--raw-unsigned
with runtime validationmktx --raw-unsigned
with runtime validation
- Updated the logic for handling the `--from` argument in the `run` function. - Added validation for required `nonce` parameter when `--from` is not provided, ensuring necessary transaction details are specified. - Used `Address::ZERO` as a placeholder when there is no need to query provider - unit tests
302f4c5
to
4abbb30
Compare
// Check if nonce is provided when --from is not specified | ||
// See: <https://github.com/foundry-rs/foundry/issues/11110> | ||
if eth.wallet.from.is_none() && tx.nonce.is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah, that makes sense, the api is a bit weird like that because this basically reuses the regular signing function just with an optional value for returning unsigned
let provider = get_provider(&config)?; | ||
|
||
let tx_builder = CastTxBuilder::new(&provider, tx, &config) | ||
let tx_builder = CastTxBuilder::new(&provider, tx.clone(), &config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could copy the nonce first, but this would just introduce another variable and doesnt really matter for this command
…idation (foundry-rs#11111) * fix(mktx): improve handling of `--raw-unsigned` with runtime validation - Updated the logic for handling the `--from` argument in the `run` function. - Added validation for required `nonce` parameter when `--from` is not provided, ensuring necessary transaction details are specified. - Used `Address::ZERO` as a placeholder when there is no need to query provider - unit tests * fix: fmt
* fix(cast): use all providers if local artifacts used (#11090) * fix(cast): use all providers if local artifacts used * Fix * fix(cast): improve handling of `mktx --raw-unsigned` with runtime validation (#11111) * fix(mktx): improve handling of `--raw-unsigned` with runtime validation - Updated the logic for handling the `--from` argument in the `run` function. - Added validation for required `nonce` parameter when `--from` is not provided, ensuring necessary transaction details are specified. - Used `Address::ZERO` as a placeholder when there is no need to query provider - unit tests * fix: fmt * fix(`anvil`): unwrap panic in `eth/backend/mem/mod.rs` (#11141) make typed request casting not panic and return useful error to user * fix(forge): consistent handling unresolved imports (#11164) * fix(forge): consistent handling unresolved imports * Add test * fix(lint): exclude disabled ids in multi-lint passes (#11122) * fix: use empty 7702 auths (#11182) * fix(forge): bump compilers to fix remapping sol file (#11184) * Bump compilers 0.18.2 * Add test * fix(coverage): disambiguate duplicate function names (#11188) * fix(forge): set state changes journal in active fork (#11196) * chore(ci): fix `typos` CI job failing (#11198) fix typos * Bump version 1.3.1 (#11199) * fix(forge): improve error messages for etherscan verification failures (#11194) * fix(forge): improve error messages for etherscan verification failures * fix: cargo clippy * tests(forge): add tests for unknown chain id * fix: err formating for EtherscanConfigError --------- Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com> * chore(tests): bump forge-std version (#11174) * chore: bump forge-std version used for tests * Fixes --------- Co-authored-by: DaniPopes <DaniPopes@users.noreply.github.com> Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com> --------- Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com> Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com> Co-authored-by: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Co-authored-by: Shiyas Mohammed <83513144+shiyasmohd@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: DaniPopes <DaniPopes@users.noreply.github.com>
…idation (foundry-rs#11111) * fix(mktx): improve handling of `--raw-unsigned` with runtime validation - Updated the logic for handling the `--from` argument in the `run` function. - Added validation for required `nonce` parameter when `--from` is not provided, ensuring necessary transaction details are specified. - Used `Address::ZERO` as a placeholder when there is no need to query provider - unit tests * fix: fmt
Motivation
Resolve #11110 with a quick fix.
A deeper refactor of the
CastTxBuilder
for building raw unsigned tx may be relevant in the future.Solution
--from
is not provided, ensuring necessary transaction details are specified.Address::ZERO
as a placeholder when there is no need to query providerPR Checklist