Skip to content

Fix Cadence parse error in FlowEVMBridgeCustomAssociations precondition message#209

Merged
joshuahannan merged 2 commits into
mainfrom
fix/custom-associations-precondition-parse-error
Apr 9, 2026
Merged

Fix Cadence parse error in FlowEVMBridgeCustomAssociations precondition message#209
joshuahannan merged 2 commits into
mainfrom
fix/custom-associations-precondition-parse-error

Conversation

@joshuahannan

@joshuahannan joshuahannan commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Simplifies the precondition error message in saveCustomAssociation (line 131) to fix a parse error on testnet
  • The previous message used ?? with escaped quotes inside string interpolation, which is not supported by the Cadence version running on testnet (though it passes on the local emulator)

Root Cause

The Cadence version on testnet is older than the one used by the local emulator, causing a syntax that works in tests to fail on deployment.

Before:

"EVM Address \(evmContractAddress.toString()) already has a custom association with \(self.associationsByEVMAddress[evmContractAddress.toString()]?.identifier ?? \"unknown type\")"

After:

"EVM Address \(evmContractAddress.toString()) already has a custom association with \(self.associationsByEVMAddress[evmContractAddress.toString()]!.identifier)"

Test plan

  • Verify contract deploys successfully to testnet after merge

…ix Cadence parse error on testnet

The previous message used string interpolation with ?? and escaped quotes
which is not supported by the Cadence version running on testnet. Simplified
to remove the duplicate association lookup from the error message.
@joshuahannan joshuahannan requested a review from a team as a code owner April 9, 2026 19:09
@github-project-automation github-project-automation Bot moved this to 👀 In Review in 🌊 Flow 4D Apr 9, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Since the precondition check already confirms the EVM address exists in
associationsByEVMAddress, the force-unwrap is safe and avoids the escaped
quote syntax that caused parse errors on testnet.
@joshuahannan joshuahannan requested a review from m-Peter April 9, 2026 19:23
@joshuahannan joshuahannan merged commit aada4ff into main Apr 9, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In Review to ✅ Done in 🌊 Flow 4D Apr 9, 2026
@joshuahannan joshuahannan deleted the fix/custom-associations-precondition-parse-error branch April 9, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants