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

[EVM] Remove special EVM type #5791

Merged
merged 11 commits into from
Apr 29, 2024
Merged

[EVM] Remove special EVM type #5791

merged 11 commits into from
Apr 29, 2024

Conversation

sideninja
Copy link
Contributor

Closes: #5414

💔 API Breaking Change

Remove the special event type for evm: evm.BlockExecuted and evm.TransactionExecuted and make them be generic Flow event types: A.{evm contract address}.EVM.TransactionExecuted and A.{evm contract address}.EVM.BlockExecuted.

@sideninja sideninja self-assigned this Apr 26, 2024
@sideninja sideninja changed the base branch from master to gregor/evm/event-field-tx April 26, 2024 14:29
@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.71%. Comparing base (f634093) to head (eda4a17).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5791      +/-   ##
==========================================
+ Coverage   55.68%   55.71%   +0.02%     
==========================================
  Files        1094     1094              
  Lines       85622    85605      -17     
==========================================
+ Hits        47681    47693      +12     
+ Misses      33326    33297      -29     
  Partials     4615     4615              
Flag Coverage Δ
unittests 55.71% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@turbolent
Copy link
Member

Could you also please remove the EVM location again from the Go SDK?

Comment on lines 105 to 109
assert.Equal(t, fmt.Sprintf(
"A.%s.%s",
sc.EVMContract.Address.String(),
types.EventTypeBlockExecuted,
), string(blockEvent.Type))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use common.Location.TypeID() instead. Same below

fvm/fvm_test.go Outdated Show resolved Hide resolved
@sideninja
Copy link
Contributor Author

Could you also please remove the EVM location again from the Go SDK?

@m-Peter plans to

Base automatically changed from gregor/evm/event-field-tx to master April 26, 2024 17:55
@sideninja sideninja enabled auto-merge April 26, 2024 18:11
@turbolent
Copy link
Member

@sideninja Maybe forgot to push? There are no new commits

@m-Peter
Copy link
Collaborator

m-Peter commented Apr 29, 2024

@turbolent @sideninja Here is the PR to remove the EVMLocation location from flow-go-sdk: onflow/flow-go-sdk#638
Note that this location was only incorporated into feature/stable-cadence branch.

Copy link
Collaborator

@m-Peter m-Peter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sideninja There are a couple more files that ideally should be updated:

It would also be very useful to address this suggestion as well: #5414 (comment)

We should also include the event definitions in the EVM contract itself, for example:

access(all)
event BlockExecuted(
    height: UInt64,
    hash: String,
    ...
)

access(all)
event TransactionExecuted(
    blockHeight: UInt64,
    blockHash: String,
    hash: String,
    payload: String,
    ...
    logs: String
)

This will be helpful for other tools (such as the Cadence testing framework), to make use of these types cc @turbolent

@sideninja sideninja added this pull request to the merge queue Apr 29, 2024
@sideninja
Copy link
Contributor Author

@sideninja Maybe forgot to push? There are no new commits

I did, sorry

@sideninja
Copy link
Contributor Author

@sideninja There are a couple more files that ideally should be updated:

It would also be very useful to address this suggestion as well: #5414 (comment)

We should also include the event definitions in the EVM contract itself, for example:

access(all)
event BlockExecuted(
    height: UInt64,
    hash: String,
    ...
)

access(all)
event TransactionExecuted(
    blockHeight: UInt64,
    blockHash: String,
    hash: String,
    payload: String,
    ...
    logs: String
)

This will be helpful for other tools (such as the Cadence testing framework), to make use of these types cc @turbolent

Great feedback, thanks. I like the idea of defining the event in the contract.

@sideninja sideninja removed this pull request from the merge queue due to a manual request Apr 29, 2024
Copy link
Collaborator

@m-Peter m-Peter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👌

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@sideninja sideninja added this pull request to the merge queue Apr 29, 2024
@sideninja sideninja removed this pull request from the merge queue due to a manual request Apr 29, 2024
@sideninja sideninja enabled auto-merge April 29, 2024 18:01
@sideninja sideninja added this pull request to the merge queue Apr 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 29, 2024
@turbolent turbolent added this pull request to the merge queue Apr 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 29, 2024
@turbolent turbolent added this pull request to the merge queue Apr 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 29, 2024
@sideninja sideninja added this pull request to the merge queue Apr 29, 2024
Merged via the queue into master with commit 512eb32 Apr 29, 2024
55 checks passed
@sideninja sideninja deleted the gregor/evm/event-type-id branch April 29, 2024 21:37
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.

[EVM] Bridged account creation event consolidation
6 participants