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

unknown import: ethereum::ethereum.call has not been defined #4309

Open
leoyvens opened this issue Jan 23, 2023 · 2 comments
Open

unknown import: ethereum::ethereum.call has not been defined #4309

leoyvens opened this issue Jan 23, 2023 · 2 comments
Labels
offchain Offchain data sources, such as IPFS files

Comments

@leoyvens
Copy link
Collaborator

Summary

This happens when a file data source handler uses contract calls directly or is in the same AssemblyScript file as other handlers which use contract calls. If the contract call is done by a different handler in the same file, this can be fixed by putting the file data source handler in its own file, which is best practice.

Potential Fix

Contract calls in file data source handlers could be enabled by somehow passing the ethereum.call host fn when instantiating an offchain data source, relevant code:

let host_fns = data_source
.as_onchain()
.map(|ds| runtime_adapter.host_fns(ds))
.transpose()?
.unwrap_or_default();

@leoyvens leoyvens added the offchain Offchain data sources, such as IPFS files label Jan 23, 2023
@github-actions
Copy link

Looks like this issue has been open for 6 months with no activity. Is it still relevant? If not, please remember to close it.

@github-actions github-actions bot added the Stale label Aug 10, 2023
@azf20
Copy link
Contributor

azf20 commented Aug 14, 2023

This is still relevant - @leoyvens does this fail at build-time or at runtime?

@github-actions github-actions bot removed the Stale label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
offchain Offchain data sources, such as IPFS files
Projects
None yet
Development

No branches or pull requests

2 participants