Skip to content

VM Bridge Bootstrapping upserts wrong template chunks in testing env #8184

@sisyphusSmiling

Description

@sisyphusSmiling

What is the severity of this bug?

The VM Bridge is bootstrapped with token chunks generated from statically declared imports relevant for the emulator namespace. Since these chunks are generated from code with static imports and address namespacing is different between emulator and the testing environment, the templates cannot be used in the testing environment. Bootstrapping the VM Bridge contracts succeeds, but the onboarding functionality for EVM-native tokens & NFTs (which correspond to Cadence deployments from these templates with invalid addresses) fails.

Reproduction steps

Steps to reproduce the behaviour:

  1. Create a Cadence test onboarding an ERC20 or ERC721 to the VM bridge
  2. When the onboarding transaction is executed, you'll see errors denoting the templates with the emulator address namespaced templates

Feel free to respond here if more context and and example is needed.

This seems to due to a lack of network context when the template chunks are selected - ref. One solution might be to include the chunks for both emulator & testing networks and select the appropriate templates for the environment's network.

Expected behaviour

The template chunks should account for the environment being bootstrapped.

Specifications

N/A

Additional context

This is a non-blocker for me atm since I will be able to work around this in my own tests. However, others may find issue with their projects as they'd expect bootstrapping to work out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions