Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
Fix bug with zero amount in EstimateGasJsonRpc
Browse files Browse the repository at this point in the history
  • Loading branch information
esen committed Oct 27, 2020
1 parent 70c5612 commit b0f5033
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EthereumKit/Classes/Api/JsonRpc/EstimateGasJsonRpc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class EstimateGasJsonRpc: IntJsonRpc {
params["to"] = to.hex
}
if let amount = amount {
params["value"] = "0x" + amount.serialize().hex.removeLeadingZeros()
params["value"] = "0x" + (amount == 0 ? "0" : amount.serialize().hex.removeLeadingZeros())
}
if let gasLimit = gasLimit {
params["gas"] = "0x" + String(gasLimit, radix: 16).removeLeadingZeros()
Expand Down

0 comments on commit b0f5033

Please sign in to comment.