onflow / cadence-tools

Developer tools for Cadence
https://www.onflow.org/
Apache License 2.0
24 stars 20 forks source link

[test] Add full support for `EVM` contract and core events #330

Open m-Peter opened 3 months ago

m-Peter commented 3 months ago

Description

Examples:

import Test
import CoreEvents

access(all)
fun test() {
    let account = Test.createAccount()

    let typ = Type<CoreEvents.AccountCreated>()
    let events = Test.eventsOfType(typ)
    Test.expect(events.length, Test.beGreaterThan(1))

    let accountCreatedEvent = events[0] as! CoreEvents.AccountCreated
    Test.assertEqual(
        Address(0x0000000000000006),
        accountCreatedEvent.address
    )
}