Open austinkline opened 8 months ago
Unfortunately this comes from Cadence itself. Events are currently not "first-class" citizens, in that they cannot be used as argument types / return types or be constructed and assigned to variables. However, we can use their type for type-casting, as you have done here:
let events = Test.eventsOfType(Type<Foo.SomeEvent>()).removeLast() as! Foo.SomeEvent
The above methods contain the business logic for which CompositeTypes can be used as argument types & return types.
Current Behavior
I am not able to use an event signature as a return type in the cadence testing framework:
Expected Behavior
It would be great to allow these kinds of return signatures so I can cut down on copy/paste code. Usually I need the same type of event over and over when writing tests and was hoping I could write a helper to achieve this more easily
Steps To Reproduce
Environment