remove upraises
we no longer support nim 1.2.x, so upraises is no longer necessary
This commit is contained in:
parent
04b91d9f65
commit
c25de86656
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import pkg/stint
|
||||
import pkg/upraises
|
||||
|
||||
push: {.upraises: [].}
|
||||
{.push raises:[].}
|
||||
|
||||
type
|
||||
BlockTagKind = enum
|
||||
|
|
|
@ -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,
|
||||
|
@ -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)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import ./provider
|
|||
type
|
||||
Event* = object of RootObj
|
||||
|
||||
push: {.upraises: [].}
|
||||
{.push raises:[].}
|
||||
|
||||
template indexed* {.pragma.}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ export basics
|
|||
export transaction
|
||||
export blocktag
|
||||
|
||||
push: {.upraises: [].}
|
||||
{.push raises: [].}
|
||||
|
||||
type
|
||||
Provider* = ref object of RootObj
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
|
|
@ -17,7 +17,7 @@ export basics
|
|||
export provider
|
||||
export chronicles
|
||||
|
||||
push: {.upraises: [].}
|
||||
{.push raises: [].}
|
||||
|
||||
logScope:
|
||||
topics = "ethers jsonrpc"
|
||||
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue