This commit is contained in:
Eric 2023-10-18 15:53:24 +11:00
parent 512b29bf72
commit 06dc6c4d65
No known key found for this signature in database
3 changed files with 2 additions and 19 deletions

View File

@ -73,7 +73,7 @@ type
transactionType*: ?TransactionType
chainId*: ?UInt256
value*: UInt256
v*, r*, s* : UInt256
v*, r*, s*: UInt256
const EthersDefaultConfirmations* {.intdefine.} = 12
const EthersReceiptTimeoutBlks* {.intdefine.} = 50 # in blocks
@ -81,9 +81,6 @@ const EthersReceiptTimeoutBlks* {.intdefine.} = 50 # in blocks
logScope:
topics = "ethers provider"
template raiseProviderError(message: string) =
raise newException(ProviderError, message)
func toTransaction*(past: PastTransaction): Transaction =
Transaction(
sender: some past.sender,
@ -102,11 +99,6 @@ method getBlockNumber*(provider: Provider): Future[UInt256] {.base, gcsafe.} =
method getBlock*(provider: Provider, tag: BlockTag): Future[?Block] {.base, gcsafe.} =
doAssert false, "not implemented"
method call*(provider: Provider,
tx: JsonNode,
blockTag = BlockTag.latest): Future[seq[byte]] {.base, gcsafe.} =
doAssert false, "not implemented"
method call*(provider: Provider,
tx: Transaction,
blockTag = BlockTag.latest): Future[seq[byte]] {.base, gcsafe.} =
@ -200,7 +192,7 @@ method getRevertReason*(
without blockNumber =? receipt.blockNumber:
return none string
return await provider.getRevertReason(receipt.transactionHash, blockNumber)
return await provider.getRevertReason(receipt.transactionHash, blockNumber - 1)
proc confirm*(tx: TransactionResponse,
confirmations = EthersDefaultConfirmations,

View File

@ -123,13 +123,6 @@ method getBlock*(provider: JsonRpcProvider,
let client = await provider.client
return await client.eth_getBlockByNumber(tag, false)
method call*(provider: JsonRpcProvider,
tx: JsonNode,
blockTag = BlockTag.latest): Future[seq[byte]] {.async.} =
convertError:
let client = await provider.client
return await client.eth_call(tx, blockTag)
method call*(provider: JsonRpcProvider,
tx: Transaction,
blockTag = BlockTag.latest): Future[seq[byte]] {.async.} =

View File

@ -2,8 +2,6 @@ proc net_version(): string
proc eth_accounts: seq[Address]
proc eth_blockNumber: UInt256
proc eth_call(transaction: Transaction, blockTag: BlockTag): seq[byte]
proc eth_call(transaction: PastTransaction, blockTag: BlockTag): seq[byte]
proc eth_call(transaction: JsonNode, blockTag: BlockTag): seq[byte]
proc eth_gasPrice(): UInt256
proc eth_getBlockByNumber(blockTag: BlockTag, includeTransactions: bool): ?Block
proc eth_getLogs(filter: EventFilter | Filter | FilterByBlockHash): JsonNode