remove upraises

we no longer support nim 1.2.x,
so upraises is no longer necessary
This commit is contained in:
Mark Spanbroek 2023-12-12 09:24:37 +01:00 committed by markspanbroek
parent 04b91d9f65
commit c25de86656
8 changed files with 13 additions and 17 deletions

View File

@ -8,7 +8,6 @@ requires "chronicles >= 0.10.3 & < 0.11.0"
requires "chronos >= 3.0.0 & < 4.0.0" requires "chronos >= 3.0.0 & < 4.0.0"
requires "contractabi >= 0.6.0 & < 0.7.0" requires "contractabi >= 0.6.0 & < 0.7.0"
requires "questionable >= 0.10.2 & < 0.11.0" requires "questionable >= 0.10.2 & < 0.11.0"
requires "upraises >= 0.1.0 & < 0.2.0"
requires "json_rpc" requires "json_rpc"
requires "stint" requires "stint"
requires "stew" requires "stew"

View File

@ -2,14 +2,12 @@ import pkg/chronos
import pkg/questionable import pkg/questionable
import pkg/questionable/results import pkg/questionable/results
import pkg/stint import pkg/stint
import pkg/upraises
import pkg/contractabi/address import pkg/contractabi/address
export chronos export chronos
export questionable export questionable
export results export results
export stint export stint
export upraises
export address export address
type type

View File

@ -1,7 +1,6 @@
import pkg/stint import pkg/stint
import pkg/upraises
push: {.upraises: [].} {.push raises:[].}
type type
BlockTagKind = enum BlockTagKind = enum

View File

@ -34,7 +34,7 @@ type
ContractError* = object of EthersError ContractError* = object of EthersError
Confirmable* = ?TransactionResponse Confirmable* = ?TransactionResponse
EventHandler*[E: Event] = proc(event: E) {.gcsafe, upraises:[].} EventHandler*[E: Event] = proc(event: E) {.gcsafe, raises:[].}
func new*(ContractType: type Contract, func new*(ContractType: type Contract,
address: Address, address: Address,
@ -235,7 +235,7 @@ proc subscribe*[E: Event](contract: Contract,
let topic = topic($E, E.fieldTypes).toArray let topic = topic($E, E.fieldTypes).toArray
let filter = EventFilter(address: contract.address, topics: @[topic]) let filter = EventFilter(address: contract.address, topics: @[topic])
proc logHandler(log: Log) {.upraises: [].} = proc logHandler(log: Log) {.raises: [].} =
if event =? E.decode(log.data, log.topics): if event =? E.decode(log.data, log.topics):
handler(event) handler(event)

View File

@ -6,7 +6,7 @@ import ./provider
type type
Event* = object of RootObj Event* = object of RootObj
push: {.upraises: [].} {.push raises:[].}
template indexed* {.pragma.} template indexed* {.pragma.}

View File

@ -8,7 +8,7 @@ export basics
export transaction export transaction
export blocktag export blocktag
push: {.upraises: [].} {.push raises: [].}
type type
Provider* = ref object of RootObj Provider* = ref object of RootObj
@ -52,8 +52,8 @@ type
effectiveGasPrice*: ?UInt256 effectiveGasPrice*: ?UInt256
status*: TransactionStatus status*: TransactionStatus
transactionType*: TransactionType transactionType*: TransactionType
LogHandler* = proc(log: Log) {.gcsafe, upraises:[].} LogHandler* = proc(log: Log) {.gcsafe, raises:[].}
BlockHandler* = proc(blck: Block) {.gcsafe, upraises:[].} BlockHandler* = proc(blck: Block) {.gcsafe, raises:[].}
Topic* = array[32, byte] Topic* = array[32, byte]
Block* = object Block* = object
number*: ?UInt256 number*: ?UInt256
@ -200,7 +200,7 @@ method getRevertReason*(
proc ensureSuccess( proc ensureSuccess(
provider: Provider, provider: Provider,
receipt: TransactionReceipt receipt: TransactionReceipt
) {.async, upraises: [ProviderError].} = ) {.async, raises: [ProviderError].} =
## If the receipt.status is Failed, the tx is replayed to obtain a revert ## If the receipt.status is Failed, the tx is replayed to obtain a revert
## reason, after which a ProviderError with the revert reason is raised. ## reason, after which a ProviderError with the revert reason is raised.
## If no revert reason was obtained ## If no revert reason was obtained
@ -223,7 +223,7 @@ proc confirm*(tx: TransactionResponse,
confirmations = EthersDefaultConfirmations, confirmations = EthersDefaultConfirmations,
timeout = EthersReceiptTimeoutBlks): timeout = EthersReceiptTimeoutBlks):
Future[TransactionReceipt] Future[TransactionReceipt]
{.async, upraises: [ProviderError, EthersError].} = {.async, raises: [ProviderError, EthersError].} =
## Waits for a transaction to be mined and for the specified number of blocks ## Waits for a transaction to be mined and for the specified number of blocks
## to pass since it was mined (confirmations). ## to pass since it was mined (confirmations).
## A timeout, in blocks, can be specified that will raise an error if too many ## A timeout, in blocks, can be specified that will raise an error if too many

View File

@ -17,7 +17,7 @@ export basics
export provider export provider
export chronicles export chronicles
push: {.upraises: [].} {.push raises: [].}
logScope: logScope:
topics = "ethers jsonrpc" topics = "ethers jsonrpc"
@ -34,7 +34,7 @@ type
subscriptions: JsonRpcSubscriptions subscriptions: JsonRpcSubscriptions
id: JsonNode id: JsonNode
proc raiseJsonRpcProviderError(message: string) {.upraises: [JsonRpcProviderError].} = proc raiseJsonRpcProviderError(message: string) {.raises: [JsonRpcProviderError].} =
var message = message var message = message
try: try:
message = parseJson(message){"message"}.getStr message = parseJson(message){"message"}.getStr

View File

@ -12,7 +12,7 @@ type
JsonRpcSubscriptions* = ref object of RootObj JsonRpcSubscriptions* = ref object of RootObj
client: RpcClient client: RpcClient
callbacks: Table[JsonNode, SubscriptionCallback] callbacks: Table[JsonNode, SubscriptionCallback]
SubscriptionCallback = proc(id, arguments: JsonNode) {.gcsafe, upraises:[].} SubscriptionCallback = proc(id, arguments: JsonNode) {.gcsafe, raises:[].}
method subscribeBlocks*(subscriptions: JsonRpcSubscriptions, method subscribeBlocks*(subscriptions: JsonRpcSubscriptions,
onBlock: BlockHandler): onBlock: BlockHandler):
@ -55,7 +55,7 @@ type
proc new*(_: type JsonRpcSubscriptions, proc new*(_: type JsonRpcSubscriptions,
client: RpcWebSocketClient): JsonRpcSubscriptions = client: RpcWebSocketClient): JsonRpcSubscriptions =
let subscriptions = WebSocketSubscriptions(client: client) let subscriptions = WebSocketSubscriptions(client: client)
proc subscriptionHandler(arguments: JsonNode) {.upraises:[].} = proc subscriptionHandler(arguments: JsonNode) {.raises:[].} =
if id =? arguments["subscription"].catch and if id =? arguments["subscription"].catch and
callback =? subscriptions.getCallback(id): callback =? subscriptions.getCallback(id):
callback(id, arguments) callback(id, arguments)