8000 fix: remove redundant --contract-address parameter from worm submit command by DeVikingMark · Pull Request #4376 · wormhole-foundation/wormhole · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: remove redundant --contract-address parameter from worm submit command #4376

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DeVikingMark
Copy link

Resolved a TODO comment in the Aptos upgrade script by removing the redundant --contract-address parameter from the worm submit command.

The SDK already knows the contract addresses for each chain and module, making the explicit parameter unnecessary.

Instead, the script now uses the --chain parameter to specify Aptos as the target chain, allowing the SDK to automatically resolve the correct contract address.

Changes:

  • Removed --contract-address parameter from worm submit command
  • Added --chain aptos parameter for explicit chain targeting
  • Removed the related TODO comment

@johnsaigle
Copy link
Contributor

Can you show an example of test output that shows that this is correct, as well as link to the contract address in the SDK? It would be good to also add test instructions so that someone can reproduce this.

@DeVikingMark
Copy link
Author

Hi @johnsaigle! Here's the proof that this change is correct:

SDK automatically knows contract addresses

The SDK has built-in contract addresses for all chains. When you don't specify --contract-address, it automatically uses the correct one.

Test output showing SDK knows Aptos addresses:

$ worm info contract testnet aptos Core
0x5bc11445584a763c1fa7ed39081f1b920954da14e04b32440cba863d03e19625

Link to SDK code

The SDK automatically resolves addresses here:
https://github.com/wormhole-foundation/wormhole/blob/main/clients/js/src/aptos.ts#L32-35

contract = contract ?? contracts.coreBridge.get(network, chain);

Before vs After

Before (redundant):

worm submit $VAA --chain aptos --contract-address 0x5bc1... --network testnet

After (simplified):

worm submit --network testnet $VAA --chain aptos

Both commands do exactly the same thing - the SDK automatically finds the contract address.

Test instructions

cd clients/js
npm install && npm run build
node build/main.js info contract testnet aptos Core

This change removes redundant code while maintaining identical functionality.

80F8

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.

2 participants
0