nim-ethers/testmodule
Eric Mastro ff3173986f
Support distinct types for Event fields
Add support for indexed (and non-indexed) Event fields types that are distinct `ValueType` or `SmallByteArray`. For example,
```nim
type
  DistinctAlias = distinct array[32, byte]
  MyEvent = object of Event
    a {.indexed.}: DistinctAlias
    b: DistinctAlias # also allowed for non-indexed fields

## The below funcs generally need to be included for ABI
## encoding/decoding purposes when implementing distinct types.

func toArray(value: DistinctAlias): array[32, byte] =
  array[32, byte](value)

func encode*(encoder: var AbiEncoder, value: DistinctAlias) =
  encoder.write(value.toArray)

func decode*(decoder: var AbiDecoder,
             T: type DistinctAlias): ?!T =
  let d = ?decoder.read(type array[32, byte])
  success DistinctAlias(d)
```
2022-09-05 15:35:50 +10:00
..
config.nims Ensure that tests run on Nim 1.2.x 2022-01-26 17:58:51 +01:00
examples.nim Add Signer.populateTransaction() 2022-01-25 10:25:09 +01:00
hardhat.nim Introduce Contract abstraction 2022-01-20 12:56:18 +01:00
miner.nim Refactor based on PR comments 2022-05-23 11:27:26 +10:00
mocks.nim Allow for custom transaction properties 2022-07-13 09:04:48 +02:00
test.nim Add first tests for wallet 2022-08-08 12:40:36 +02:00
test.nimble Allow types that are equivalent to Confirmable 2022-05-25 09:13:44 +02:00
testContracts.nim Introduce separate type for transaction overrides 2022-07-13 09:04:48 +02:00
testEnums.nim Allow enums to be used as function parameters 2022-06-15 10:52:35 +02:00
testEvents.nim Support distinct types for Event fields 2022-09-05 15:35:50 +10:00
testJsonRpcProvider.nim Fix intermittent test failure 2022-07-13 09:04:48 +02:00
testJsonRpcSigner.nim Add Signer.signMessage() 2022-01-26 11:21:28 +01:00
testReturns.nim Handle multiple return types on a contract call 2022-06-14 16:27:43 +02:00
testWallet.nim [wallet] cleanup 2022-08-08 15:07:41 +02:00