Move.

Post

Share your knowledge.

farshad.
Feb 13, 2025
Expert Q&A

How to handle function signature changes in SUI Move Package

I'm working on a SUI Move package and encountered an error when I tried to change a function signature. The error message is 'PackageUpgradeError { upgrade_error: IncompatibleUpgrade }'. How can I upgrade the package with the new function signature without causing errors?

  • Move CLI
0
1
Share
Comments
.

Answers

1
Forever_A-gator.
Feb 13 2025, 11:09

You can't make changes to function signatures directly in a SUI Move package upgrade. Instead, you can add a new function with the desired signature and logic but you cannot remove the old function. Removing or changing existing function signatures isn't supported for upgrades, as this could break compatibility with existing packages or data dependent on the old function definitions. A useful workaround is to create a helper function or wrapper that includes the new functionality. Check the official documentation on SUI Move package upgrades for further guidance: https://docs.sui.io/concepts/sui-move-concepts/packages/upgrade#upgrade-requirements

1
Comments
.

Do you know the answer?

Please log in and share it.

We use cookies to ensure you get the best experience on our website.
More info