small fixes
This commit is contained in:
parent
79be8f1ab8
commit
8bb02dd479
@ -1955,7 +1955,7 @@ impl Call for Client {
|
|||||||
gas_used: U256::default(),
|
gas_used: U256::default(),
|
||||||
gas_limit: U256::max_value(),
|
gas_limit: U256::max_value(),
|
||||||
//if gas pricing is not defined, force base_fee to zero
|
//if gas pricing is not defined, force base_fee to zero
|
||||||
base_fee: if transaction.effective_gas_price(header.base_fee()) == 0.into() {
|
base_fee: if transaction.effective_gas_price(header.base_fee()).is_zero() {
|
||||||
Some(0.into())
|
Some(0.into())
|
||||||
} else {
|
} else {
|
||||||
header.base_fee()
|
header.base_fee()
|
||||||
@ -1988,7 +1988,7 @@ impl Call for Client {
|
|||||||
|
|
||||||
for &(ref t, analytics) in transactions {
|
for &(ref t, analytics) in transactions {
|
||||||
//if gas pricing is not defined, force base_fee to zero
|
//if gas pricing is not defined, force base_fee to zero
|
||||||
if t.effective_gas_price(header.base_fee()) == 0.into() {
|
if t.effective_gas_price(header.base_fee()).is_zero() {
|
||||||
env_info.base_fee = Some(0.into());
|
env_info.base_fee = Some(0.into());
|
||||||
} else {
|
} else {
|
||||||
env_info.base_fee = header.base_fee()
|
env_info.base_fee = header.base_fee()
|
||||||
@ -2020,7 +2020,7 @@ impl Call for Client {
|
|||||||
last_hashes: self.build_last_hashes(header.parent_hash()),
|
last_hashes: self.build_last_hashes(header.parent_hash()),
|
||||||
gas_used: U256::default(),
|
gas_used: U256::default(),
|
||||||
gas_limit: max,
|
gas_limit: max,
|
||||||
base_fee: if t.effective_gas_price(header.base_fee()) == 0.into() {
|
base_fee: if t.effective_gas_price(header.base_fee()).is_zero() {
|
||||||
Some(0.into())
|
Some(0.into())
|
||||||
} else {
|
} else {
|
||||||
header.base_fee()
|
header.base_fee()
|
||||||
|
@ -660,10 +660,10 @@ impl TypedTransaction {
|
|||||||
pub fn is_service(&self) -> bool {
|
pub fn is_service(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Self::EIP1559Transaction(tx) => {
|
Self::EIP1559Transaction(tx) => {
|
||||||
tx.tx().gas_price == 0.into() && tx.max_priority_fee_per_gas == 0.into()
|
tx.tx().gas_price.is_zero() && tx.max_priority_fee_per_gas.is_zero()
|
||||||
}
|
}
|
||||||
Self::AccessList(tx) => tx.tx().gas_price == 0.into(),
|
Self::AccessList(tx) => tx.tx().gas_price.is_zero(),
|
||||||
Self::Legacy(tx) => tx.gas_price == 0.into(),
|
Self::Legacy(tx) => tx.gas_price.is_zero(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user