Skip to content

Commit

Permalink
remove upraises
Browse files Browse the repository at this point in the history
we no longer support nim 1.2.x,
so upraises is no longer necessary
  • Loading branch information
markspanbroek committed Dec 12, 2023
1 parent 04b91d9 commit 8435bd9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 17 deletions.
1 change: 0 additions & 1 deletion ethers.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ requires "chronicles >= 0.10.3 & < 0.11.0"
requires "chronos >= 3.0.0 & < 4.0.0"
requires "contractabi >= 0.6.0 & < 0.7.0"
requires "questionable >= 0.10.2 & < 0.11.0"
requires "upraises >= 0.1.0 & < 0.2.0"
requires "json_rpc"
requires "stint"
requires "stew"
Expand Down
2 changes: 0 additions & 2 deletions ethers/basics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import pkg/chronos
import pkg/questionable
import pkg/questionable/results
import pkg/stint
import pkg/upraises
import pkg/contractabi/address

export chronos
export questionable
export results
export stint
export upraises
export address

type
Expand Down
3 changes: 1 addition & 2 deletions ethers/blocktag.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pkg/stint
import pkg/upraises

push: {.upraises: [].}
{.push raises:[].}

type
BlockTagKind = enum
Expand Down
4 changes: 2 additions & 2 deletions ethers/contract.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type

ContractError* = object of EthersError
Confirmable* = ?TransactionResponse
EventHandler*[E: Event] = proc(event: E) {.gcsafe, upraises:[].}
EventHandler*[E: Event] = proc(event: E) {.gcsafe, raises:[].}

func new*(ContractType: type Contract,
address: Address,
Expand Down Expand Up @@ -235,7 +235,7 @@ proc subscribe*[E: Event](contract: Contract,
let topic = topic($E, E.fieldTypes).toArray
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):
handler(event)

Expand Down
2 changes: 1 addition & 1 deletion ethers/events.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ./provider
type
Event* = object of RootObj

push: {.upraises: [].}
{.push raises:[].}

template indexed* {.pragma.}

Expand Down
10 changes: 5 additions & 5 deletions ethers/provider.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export basics
export transaction
export blocktag

push: {.upraises: [].}
{.push raises: [].}

type
Provider* = ref object of RootObj
Expand Down Expand Up @@ -52,8 +52,8 @@ type
effectiveGasPrice*: ?UInt256
status*: TransactionStatus
transactionType*: TransactionType
LogHandler* = proc(log: Log) {.gcsafe, upraises:[].}
BlockHandler* = proc(blck: Block) {.gcsafe, upraises:[].}
LogHandler* = proc(log: Log) {.gcsafe, raises:[].}
BlockHandler* = proc(blck: Block) {.gcsafe, raises:[].}
Topic* = array[32, byte]
Block* = object
number*: ?UInt256
Expand Down Expand Up @@ -200,7 +200,7 @@ method getRevertReason*(
proc ensureSuccess(
provider: Provider,
receipt: TransactionReceipt
) {.async, upraises: [ProviderError].} =
) {.async, raises: [ProviderError].} =
## 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.
## If no revert reason was obtained
Expand All @@ -223,7 +223,7 @@ proc confirm*(tx: TransactionResponse,
confirmations = EthersDefaultConfirmations,
timeout = EthersReceiptTimeoutBlks):
Future[TransactionReceipt]
{.async, upraises: [ProviderError, EthersError].} =
{.async, raises: [ProviderError, EthersError].} =
## Waits for a transaction to be mined and for the specified number of blocks
## to pass since it was mined (confirmations).
## A timeout, in blocks, can be specified that will raise an error if too many
Expand Down
4 changes: 2 additions & 2 deletions ethers/providers/jsonrpc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export basics
export provider
export chronicles

push: {.upraises: [].}
{.push raises: [].}

logScope:
topics = "ethers jsonrpc"
Expand All @@ -34,7 +34,7 @@ type
subscriptions: JsonRpcSubscriptions
id: JsonNode

proc raiseJsonRpcProviderError(message: string) {.upraises: [JsonRpcProviderError].} =
proc raiseJsonRpcProviderError(message: string) {.raises: [JsonRpcProviderError].} =
var message = message
try:
message = parseJson(message){"message"}.getStr
Expand Down
4 changes: 2 additions & 2 deletions ethers/providers/jsonrpc/subscriptions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type
JsonRpcSubscriptions* = ref object of RootObj
client: RpcClient
callbacks: Table[JsonNode, SubscriptionCallback]
SubscriptionCallback = proc(id, arguments: JsonNode) {.gcsafe, upraises:[].}
SubscriptionCallback = proc(id, arguments: JsonNode) {.gcsafe, raises:[].}

method subscribeBlocks*(subscriptions: JsonRpcSubscriptions,
onBlock: BlockHandler):
Expand Down Expand Up @@ -55,7 +55,7 @@ type
proc new*(_: type JsonRpcSubscriptions,
client: RpcWebSocketClient): JsonRpcSubscriptions =
let subscriptions = WebSocketSubscriptions(client: client)
proc subscriptionHandler(arguments: JsonNode) {.upraises:[].} =
proc subscriptionHandler(arguments: JsonNode) {.raises:[].} =
if id =? arguments["subscription"].catch and
callback =? subscriptions.getCallback(id):
callback(id, arguments)
Expand Down

0 comments on commit 8435bd9

Please sign in to comment.