Closed NicolasWent closed 3 months ago
primitives
The gas configurations have been set to u128 instead of U256 in the alloy TransactionBuilder
It would be nice to have an into() implementation for a ParseUnits to convert it directly to u128.
into()
This way we would be able to set the max priority fee per gas (and max_fee_per_gas) more smoothly:
// Currently not working: my_transaction_builder.max_priority_fee_per_gas(parse_units("0.1", "gwei").unwrap().into());
Instead of the current workaround:
let max_priority_fee_per_gas: U256 = parse_units("0.1", "gwei").unwrap().into(); my_transaction_build.max_priority_fee_per_gas(max_priority_fee_per_gas.to());
This should be TryFrom since 256 -> 128 bits is fallible. Other options:
TryFrom
parse_units(...)?.get_absolute().to()
0.1e9 as u128
const GWEI: u128 = 1e9 as u128; GWEI / 10
Component
primitives
Describe the feature you would like
The gas configurations have been set to u128 instead of U256 in the alloy TransactionBuilder
It would be nice to have an
into()
implementation for a ParseUnits to convert it directly to u128.This way we would be able to set the max priority fee per gas (and max_fee_per_gas) more smoothly:
Instead of the current workaround: