Skip to content

Commit

Permalink
fix proposeAppVersion to always set false initially to AppInfo.consumed
Browse files Browse the repository at this point in the history
Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed Oct 8, 2024
1 parent b21d1fb commit 4316b5e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
10 changes: 7 additions & 3 deletions contracts/IBCContractUpgradableModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ abstract contract IBCContractUpgradableModuleBase is
/**
* @dev See {IIBCContractUpgradableModule-proposeAppVersion}
*/
function proposeAppVersion(string calldata version, AppInfo calldata appInfo_)
function proposeAppVersion(string calldata version, address implementation, bytes calldata initialCalldata)
external
override(IIBCContractUpgradableModule)
onlyContractUpgrader
{
if (appInfo_.implementation == address(0)) {
if (implementation == address(0)) {
revert IBCContractUpgradableModuleAppInfoProposedWithZeroImpl();
}

Expand All @@ -58,7 +58,11 @@ abstract contract IBCContractUpgradableModuleBase is
revert IBCContractUpgradableModuleAppInfoIsAlreadySet();
}

appInfos[version] = appInfo_;
appInfos[version] = AppInfo({
implementation: implementation,
initialCalldata: initialCalldata,
consumed: false
});
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/IIBCContractUpgradableModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface IIBCContractUpgradableModule {
* To upgrade the IBC module contract along with a channel upgrade, the upgrader must
* call this function before calling `channelUpgradeInit` or `channelUpgradeTry` of the IBC handler.
*/
function proposeAppVersion(string calldata version, AppInfo calldata appInfo) external;
function proposeAppVersion(string calldata version, address implementation, bytes calldata initialCalldata) external;

}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pkg/relay/ethereum/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,8 @@ func (c *Chain) ProposeAppVersion(
tx, err := mockApp.ProposeAppVersion(
txOpts,
version,
iibccontractupgradablemodule.IIBCContractUpgradableModuleAppInfo{
Implementation: implementation,
InitialCalldata: initialCalldata,
},
implementation,
initialCalldata,
)

return processSendTxResult(ctx, logger, c, tx, err)
Expand Down

0 comments on commit 4316b5e

Please sign in to comment.