mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-02 13:43:06 +00:00
* fix(async): propagate CancelledErrors * remove CatchableError from contract macro async raises list * remove mistakenly added ContractError
26 lines
668 B
Nim
26 lines
668 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:[ProviderError, SignerError, CancelledError]).} =
|
|
|
|
return signer.address
|
|
|
|
method sendTransaction*(
|
|
signer: MockSigner,
|
|
transaction: Transaction): Future[TransactionResponse]
|
|
{.async: (raises:[SignerError, ProviderError, CancelledError]).} =
|
|
|
|
signer.transactions.add(transaction)
|