Skip to content

Commit dc24f40

Browse files
added one check for est gas meth
1 parent 4e8d174 commit dc24f40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web3swift/Transaction/Classes/EthereumTransaction.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ public struct EthereumTransaction: CustomStringConvertible {
254254
tx.value = transactionOptions!.value!
255255
}
256256
// MARK: - Fixing estimate gas problem: gas price param shouldn't be nil
257-
if transactionOptions != nil, let gasPricePolicy = transactionOptions!.gasPrice {
257+
if transactionOptions != nil,
258+
let gasPricePolicy = transactionOptions!.gasPrice,
259+
method == .estimateGas {
258260
switch gasPricePolicy {
259261
case .manual(let value):
260262
tx.gasPrice = value

0 commit comments

Comments
 (0)