mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-05 23:23:08 +00:00
Call eth_maxPriorityFeePerGas and returns a manual defined maxPriorityFeePerGas as a fallback
This commit is contained in:
parent
d8205e369d
commit
228d18efcc
@ -124,7 +124,7 @@ method getGasPrice*(
|
||||
|
||||
method getMaxPriorityFeePerGas*(
|
||||
provider: Provider
|
||||
): Future[UInt256] {.base, async: (raises: [ProviderError, CancelledError]).} =
|
||||
): Future[UInt256] {.base, async: (raises: [CancelledError]).} =
|
||||
doAssert false, "not implemented"
|
||||
|
||||
method getTransactionCount*(
|
||||
|
||||
@ -156,8 +156,14 @@ method getGasPrice*(
|
||||
|
||||
method getMaxPriorityFeePerGas*(
|
||||
provider: JsonRpcProvider
|
||||
): Future[UInt256] {.async: (raises: [ProviderError, CancelledError]).} =
|
||||
): Future[UInt256] {.async: (raises: [CancelledError]).} =
|
||||
try:
|
||||
convertError:
|
||||
let client = await provider.client
|
||||
return await client.eth_maxPriorityFeePerGas()
|
||||
except ProviderError:
|
||||
# If the provider does not provide the implementation
|
||||
# let's just remove the manual value
|
||||
return provider.maxPriorityFeePerGas
|
||||
|
||||
method getTransactionCount*(
|
||||
|
||||
@ -21,3 +21,4 @@ proc eth_newBlockFilter(): JsonNode
|
||||
proc eth_newFilter(filter: EventFilter): JsonNode
|
||||
proc eth_getFilterChanges(id: JsonNode): JsonNode
|
||||
proc eth_uninstallFilter(id: JsonNode): bool
|
||||
proc eth_maxPriorityFeePerGas(): UInt256
|
||||
|
||||
@ -58,7 +58,7 @@ method getGasPrice*(
|
||||
|
||||
method getMaxPriorityFeePerGas*(
|
||||
signer: Signer
|
||||
): Future[UInt256] {.async: (raises: [ProviderError, SignerError, CancelledError]).} =
|
||||
): Future[UInt256] {.async: (raises: [SignerError, CancelledError]).} =
|
||||
return await signer.provider.getMaxPriorityFeePerGas()
|
||||
|
||||
method getTransactionCount*(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user