Eric 69f90a3d67
fix: specify raises for getAddress and sendTransaction
Fixes issue where getAddress and sendTransaction could not be found for MockSigner in tests. The problem was that the async: raises update had not been applied to the MockSigner.
2024-02-02 16:31:01 +11:00

25 lines
604 B
Nim

import pkg/ethers
type MockSigner* = ref object of Signer
provider: Provider
address*: Address
transactions*: seq[Transaction]
func new*(_: type MockSigner, provider: Provider): MockSigner =
MockSigner(provider: provider)
method provider*(signer: MockSigner): Provider =
signer.provider
method getAddress*(
signer: MockSigner): Future[Address] {.async: (raises:[SignerError]).} =
return signer.address
method sendTransaction*(
signer: MockSigner,
transaction: Transaction): Future[TransactionResponse]
{.async: (raises:[SignerError]).} =
signer.transactions.add(transaction)