Skip to content

Commit c5ad4ff

Browse files
authored
Merge pull request #56 from siburu/fix-proposeAppVersion
Fix proposeAppVersion to always set false initially to AppVersion.consumed
2 parents 59edbc5 + 82067a0 commit c5ad4ff

File tree

9 files changed

+302
-28
lines changed

9 files changed

+302
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ This provides the ethereum chain module of [yui-relayer](https://github.com/hype
44

55
## Compatibility
66

7-
This module is compatible with [ibc-solidity v0.3.23](https://github.com/hyperledger-labs/yui-ibc-solidity/releases/tag/v0.3.23).
7+
This module is compatible with [ibc-solidity v0.3.39](https://github.com/hyperledger-labs/yui-ibc-solidity/releases/tag/v0.3.39).

contracts/IBCContractUpgradableModule.sol

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ abstract contract IBCContractUpgradableModuleBase is
4444
/**
4545
* @dev See {IIBCContractUpgradableModule-proposeAppVersion}
4646
*/
47-
function proposeAppVersion(string calldata version, AppInfo calldata appInfo_)
47+
function proposeAppVersion(string calldata version, address implementation, bytes calldata initialCalldata)
4848
external
4949
override(IIBCContractUpgradableModule)
5050
onlyContractUpgrader
5151
{
52-
if (appInfo_.implementation == address(0)) {
52+
if (implementation == address(0)) {
5353
revert IBCContractUpgradableModuleAppInfoProposedWithZeroImpl();
5454
}
5555

@@ -58,7 +58,11 @@ abstract contract IBCContractUpgradableModuleBase is
5858
revert IBCContractUpgradableModuleAppInfoIsAlreadySet();
5959
}
6060

61-
appInfos[version] = appInfo_;
61+
appInfos[version] = AppInfo({
62+
implementation: implementation,
63+
initialCalldata: initialCalldata,
64+
consumed: false
65+
});
6266
}
6367

6468
/**

contracts/IIBCContractUpgradableModule.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ interface IIBCContractUpgradableModule {
4040
* To upgrade the IBC module contract along with a channel upgrade, the upgrader must
4141
* call this function before calling `channelUpgradeInit` or `channelUpgradeTry` of the IBC handler.
4242
*/
43-
function proposeAppVersion(string calldata version, AppInfo calldata appInfo) external;
43+
function proposeAppVersion(string calldata version, address implementation, bytes calldata initialCalldata) external;
4444

4545
}
4646

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Datachain, Inc.",
55
"license": "Apache-2.0",
66
"dependencies": {
7-
"@hyperledger-labs/yui-ibc-solidity": "git+https://github.com/hyperledger-labs/yui-ibc-solidity.git#semver:v0.3.35",
7+
"@hyperledger-labs/yui-ibc-solidity": "git+https://github.com/hyperledger-labs/yui-ibc-solidity.git#semver:v0.3.39",
88
"@openzeppelin/contracts-upgradeable": "^5.0.2"
99
}
1010
}

pkg/contract/ibchandler/ibchandler.go

Lines changed: 272 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/contract/iibccontractupgradablemodule/iibccontractupgradablemodule.go

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/relay/ethereum/upgrade.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,8 @@ func (c *Chain) ProposeAppVersion(
136136
tx, err := mockApp.ProposeAppVersion(
137137
txOpts,
138138
version,
139-
iibccontractupgradablemodule.IIBCContractUpgradableModuleAppInfo{
140-
Implementation: implementation,
141-
InitialCalldata: initialCalldata,
142-
},
139+
implementation,
140+
initialCalldata,
143141
)
144142

145143
return processSendTxResult(ctx, logger, c, tx, err)

yui-ibc-solidity

Submodule yui-ibc-solidity updated 57 files

0 commit comments

Comments
 (0)