mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-08 16:43:09 +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*(
|
method getMaxPriorityFeePerGas*(
|
||||||
provider: Provider
|
provider: Provider
|
||||||
): Future[UInt256] {.base, async: (raises: [ProviderError, CancelledError]).} =
|
): Future[UInt256] {.base, async: (raises: [CancelledError]).} =
|
||||||
doAssert false, "not implemented"
|
doAssert false, "not implemented"
|
||||||
|
|
||||||
method getTransactionCount*(
|
method getTransactionCount*(
|
||||||
|
|||||||
@ -156,9 +156,15 @@ method getGasPrice*(
|
|||||||
|
|
||||||
method getMaxPriorityFeePerGas*(
|
method getMaxPriorityFeePerGas*(
|
||||||
provider: JsonRpcProvider
|
provider: JsonRpcProvider
|
||||||
): Future[UInt256] {.async: (raises: [ProviderError, CancelledError]).} =
|
): Future[UInt256] {.async: (raises: [CancelledError]).} =
|
||||||
convertError:
|
try:
|
||||||
return provider.maxPriorityFeePerGas
|
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*(
|
method getTransactionCount*(
|
||||||
provider: JsonRpcProvider, address: Address, blockTag = BlockTag.latest
|
provider: JsonRpcProvider, address: Address, blockTag = BlockTag.latest
|
||||||
|
|||||||
@ -21,3 +21,4 @@ proc eth_newBlockFilter(): JsonNode
|
|||||||
proc eth_newFilter(filter: EventFilter): JsonNode
|
proc eth_newFilter(filter: EventFilter): JsonNode
|
||||||
proc eth_getFilterChanges(id: JsonNode): JsonNode
|
proc eth_getFilterChanges(id: JsonNode): JsonNode
|
||||||
proc eth_uninstallFilter(id: JsonNode): bool
|
proc eth_uninstallFilter(id: JsonNode): bool
|
||||||
|
proc eth_maxPriorityFeePerGas(): UInt256
|
||||||
|
|||||||
@ -58,7 +58,7 @@ method getGasPrice*(
|
|||||||
|
|
||||||
method getMaxPriorityFeePerGas*(
|
method getMaxPriorityFeePerGas*(
|
||||||
signer: Signer
|
signer: Signer
|
||||||
): Future[UInt256] {.async: (raises: [ProviderError, SignerError, CancelledError]).} =
|
): Future[UInt256] {.async: (raises: [SignerError, CancelledError]).} =
|
||||||
return await signer.provider.getMaxPriorityFeePerGas()
|
return await signer.provider.getMaxPriorityFeePerGas()
|
||||||
|
|
||||||
method getTransactionCount*(
|
method getTransactionCount*(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user