Skip to content

Commit

Permalink
fix of gas estimation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Vlasov committed Mar 18, 2018
1 parent 2730d3c commit ad2dc78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion web3swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "web3swift"
s.version = "0.3.3"
s.version = "0.3.4"
s.summary = "Web3 implementation in vanilla Swift for iOS ans macOS"

s.description = <<-DESC
Expand Down
10 changes: 1 addition & 9 deletions web3swift/Web3/Classes/Web3+TransactionIntermediate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ extension web3.web3contract {
}
}

// public func sign(_ privateKey: Data, network: Networks? = nil) throws {
// if (network != nil) {
// self.transaction.chainID = network?.chainID
// } else if (self.web3.provider.network != nil) {
// self.transaction.chainID = self.web3.provider.network?.chainID
// }
// let _ = self.transaction.sign(privateKey: privateKey)
// }

public func send(password: String = "BANKEXFOUNDATION", options: Web3Options? = nil) -> Result<[String:String], Web3Error> {
do {
Expand All @@ -68,7 +60,7 @@ extension web3.web3contract {
if mergedOptions.gasLimit == nil {
mergedOptions.gasLimit = estimatedGasResult.value!
} else {
if (mergedOptions.gasLimit! > estimatedGasResult.value!) {
if (mergedOptions.gasLimit! < estimatedGasResult.value!) {
return Result.failure(Web3Error.inputError("Estimated gas is larger than the gas limit"))
}
}
Expand Down

0 comments on commit ad2dc78

Please sign in to comment.