Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-Peter
Copy link
Contributor

@m-Peter m-Peter commented Apr 2, 2024

Description

  • Setup the test environment to allow imports of the EVM system contract.
  • Introduce a new CoreEvents contract, to expose event definition for core Flow & EVM events.

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
    )
}

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants