multiversx / mx-sdk-js-core

MultiversX SDK for interacting with the MultiversX blockchain (in general) and Smart Contracts (in particular).
https://multiversx.github.io/mx-sdk-js-core/
Other
58 stars 37 forks source link

Missing `upgradeConstructor` in AbiRegistry #449

Closed michavie closed 2 months ago

michavie commented 2 months ago

The recent version 0.50.0 of mx-sdk-rs removes support for defining upgrade as an endpoint, and instead enforces annotation with #[upgrade] which produces the field upgradeConstructor in the ABI JSON file.

However, in the method getEndpointForUpgrade of SmartContractTransactionsFactory we assume an endpoint upgrade exists and use constructorDefinition (which refers to the init function in the smart contract) as a fallback.

As a result, attempting to upgrade smart contracts with sdk-rs framework version >= 0.50.0 fails if theinit and upgrade arguments differ.

andreibancioiu commented 2 months ago

Hello @michavie,

Thanks for reporting this :raised_hands:

We'll handle this ASAP.

andreibancioiu commented 2 months ago

@michavie, sorry for the delay, it was a busy week :pray:

We'll patch this today.

andreibancioiu commented 2 months ago

Fixed in https://github.com/multiversx/mx-sdk-js-core/releases/tag/v13.2.0.