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

Unable to retrieve Flow EVM events due to CCF decoding error #576

Closed
m-Peter opened this issue Feb 13, 2024 · 0 comments · Fixed by #583
Closed

Unable to retrieve Flow EVM events due to CCF decoding error #576

m-Peter opened this issue Feb 13, 2024 · 0 comments · Fixed by #583

Comments

@m-Peter
Copy link
Contributor

m-Peter commented Feb 13, 2024

Problem

Unable to retrieve Flow EVM events due to CCF decoding error:

error converting event for block 2: convert: ccf convert: ccf: failed to decode: invalid type ID for built-in: `evm.TransactionExecuted`

Steps to Reproduce

var err error
flowClient, err := grpc.NewBaseClient(
	defaultAccessURL,
	goGrpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
	logger.Error().Msgf("could not create flow client: %v", err)
}

data, errChan, initErr := flowClient.SubscribeEventsByBlockHeight(
	ctx,
	latestBlockHeader.Height,
	flow.EventFilter{
		EventTypes: []string{
			"evm.BlockExecuted",
			"evm.TransactionExecuted",
		},
	},
	grpc.WithHeartbeatInterval(1),
)

The problem comes from the fact that the TypeIDDecoder for EVMLocation is registered in flow-go.
Since neither flow-go-sdk nor cadence import the flow-go repository, the TypeIDDecoder never gets registered. This results in the decoding error mentioned above.
By importing the flow-go relevant package, the retrieval of events works. But users may not always use the flow-go-sdk in combination with flow-go.

Acceptance Criteria

Flow EVM events can be fetched with flow-go-sdk.

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

Successfully merging a pull request may close this issue.

1 participant