Skip to content

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

@leoyvens

Description

@leoyvens

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    offchainOffchain data sources, such as IPFS files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions