@@ -90,17 +90,17 @@ proc decodeResponse(T: type, bytes: seq[byte]): T =
90
90
91
91
proc call(provider: Provider,
92
92
transaction: Transaction,
93
- overrides: TransactionOverrides): Future[seq [byte ]] =
93
+ overrides: TransactionOverrides): Future[seq [byte ]] {.async: (raises: [ProviderError] ) . } =
94
94
if overrides of CallOverrides and
95
95
blockTag =? CallOverrides(overrides).blockTag:
96
- provider.call(transaction, blockTag)
96
+ await provider.call(transaction, blockTag)
97
97
else :
98
- provider.call(transaction)
98
+ await provider.call(transaction)
99
99
100
100
proc call(contract: Contract,
101
101
function: string ,
102
102
parameters: tuple ,
103
- overrides = TransactionOverrides()) {.async.} =
103
+ overrides = TransactionOverrides()) {.async: (raises: [ProviderError, SignerError] ) .} =
104
104
var transaction = createTransaction(contract, function, parameters, overrides)
105
105
106
106
if signer =? contract.signer and transaction.sender.isNone:
@@ -112,7 +112,7 @@ proc call(contract: Contract,
112
112
function: string ,
113
113
parameters: tuple ,
114
114
ReturnType: type ,
115
- overrides = TransactionOverrides()): Future[ReturnType] {.async.} =
115
+ overrides = TransactionOverrides()): Future[ReturnType] {.async: (raises: [ProviderError, SignerError, ContractError] ) .} =
116
116
var transaction = createTransaction(contract, function, parameters, overrides)
117
117
118
118
if signer =? contract.signer and transaction.sender.isNone:
@@ -121,13 +121,14 @@ proc call(contract: Contract,
121
121
let response = await contract.provider.call(transaction, overrides)
122
122
return decodeResponse(ReturnType, response)
123
123
124
- proc send(contract: Contract,
125
- function: string ,
126
- parameters: tuple ,
127
- overrides = TransactionOverrides()):
128
- Future[ ? TransactionResponse] {.async: (raises: [AsyncLockError] ) . } =
129
- if signer =? contract.signer:
124
+ proc send(
125
+ contract: Contract ,
126
+ function: string ,
127
+ parameters: tuple ,
128
+ overrides = TransactionOverrides()
129
+ ): Future[ ? TransactionResponse] {.async: (raises: [AsyncLockError, CancelledError, CatchableError] ) . } =
130
130
131
+ if signer =? contract.signer:
131
132
var params: seq [string ] = @ []
132
133
for param in parameters.fields:
133
134
params.add $ param
0 commit comments