Skip to content

Feat: Add support for Bold upgrade tests for v3.2.0 contracts#147

Open
Sneh1999 wants to merge 2 commits into
integrationfrom
3.2.0-espresso-contracts-upgrade-test
Open

Feat: Add support for Bold upgrade tests for v3.2.0 contracts#147
Sneh1999 wants to merge 2 commits into
integrationfrom
3.2.0-espresso-contracts-upgrade-test

Conversation

@Sneh1999

@Sneh1999 Sneh1999 commented Jun 8, 2026

Copy link
Copy Markdown

Description

In this PR we add support for Bold migration of contracts


@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a test suite for CAS migration and BoLD upgrade to version 3.2.0, including a new TypeScript template verification script and a comprehensive multi-phase bash test script. Feedback on these changes focuses on improving robustness and maintainability: adding defensive checks in the template verification script to prevent runtime crashes, refactoring hardcoded addresses (such as the light client and sequencer) into variables or dynamic queries, cleaning up temporary files and directories to prevent resource leaks, and simplifying redundant conditional blocks that check the debug flag.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +67 to +75
for (const [key, value] of Object.entries(templates)) {
if (typeof value === 'string') {
await checkAddress(key, value)
} else {
for (const [subkey, subvalue] of Object.entries(value)) {
await checkAddress(`${key}.${subkey}`, subvalue)
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current implementation of verifyCreatorTemplates assumes that all properties of templates are either strings or nested objects. However, if any property is undefined or null at runtime (for example, if the input object is incomplete), typeof value will not be 'string'. It will fall into the else block, where calling Object.entries(value) on undefined or null will throw a TypeError: Cannot convert undefined or null to object.

To prevent runtime crashes, we should add defensive checks to ensure value is a valid object before calling Object.entries on it.

  for (const [key, value] of Object.entries(templates)) {
    if (typeof value === 'string') {
      await checkAddress(key, value)
    } else if (value && typeof value === 'object') {
      for (const [subkey, subvalue] of Object.entries(value)) {
        if (typeof subvalue === 'string') {
          await checkAddress(key + '.' + subkey, subvalue)
        }
      }
    }
  }

Comment thread espresso-tests/cas-migration-test.bash
Comment thread espresso-tests/cas-migration-test.bash
Comment thread espresso-tests/cas-migration-test.bash Outdated
Comment thread espresso-tests/cas-migration-test.bash
Comment thread espresso-tests/cas-migration-test.bash Outdated
Comment thread espresso-tests/cas-migration-test.bash
Comment thread espresso-tests/cas-migration-test.bash Outdated
@Sneh1999 Sneh1999 marked this pull request as ready for review June 9, 2026 14:47
@Sneh1999 Sneh1999 requested a review from varun-doshi June 9, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants