diff --git a/testmodule/testEvents.nim b/testmodule/testEvents.nim index a104b46..66ac0ba 100644 --- a/testmodule/testEvents.nim +++ b/testmodule/testEvents.nim @@ -5,24 +5,12 @@ import ./examples ## Define outside the scope of the suite to allow for exporting ## To use custom distinct types, these procs will generally need -## to be defined in the application code anyway, to support ABI -## encoding/decoding +## to be defined in the application code anyway type DistinctAlias = distinct array[32, byte] proc `==`*(x, y: DistinctAlias): bool {.borrow.} -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) - suite "Events": type @@ -75,9 +63,6 @@ suite "Events": a: DistinctAlias(array[32, byte].example) ) - func encode(_: type AbiEncoder, value: DistinctAlias): seq[byte] = - @(value.toArray) - func encode[T](_: type Topic, value: T): Topic = let encoded = AbiEncoder.encode(value) result[0..