@@ -11,12 +11,14 @@ import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
1111import {
1212 MsgInitiateTx,
1313 MsgInitiateTxResponse,
14- ContractTransaction
14+ ContractTransaction,
15+ QuerySelfXCCResponse
1516} from "../src/proto/cross/core/initiator/Initiator.sol " ;
1617import {Account as AuthAccount, AuthType, TxAuthState} from "../src/proto/cross/core/auth/Auth.sol " ;
1718import {GoogleProtobufAny} from "@hyperledger-labs/yui-ibc-solidity/contracts/proto/GoogleProtobufAny.sol " ;
1819import {Tx} from "../src/proto/cross/core/tx/Tx.sol " ;
1920import {IbcCoreClientV1Height} from "../src/proto/ibc/core/client/v1/client.sol " ;
21+ import {ChannelInfo} from "../src/proto/cross/core/xcc/XCC.sol " ;
2022
2123contract MockTxManager is TxManagerBase {
2224 mapping (bytes32 => bool ) public txExists;
@@ -128,9 +130,14 @@ contract InitiatorTest is Test {
128130 assertEq (harness.CHAIN_ID_HASH (), expected, "CHAIN_ID_HASH mismatch " );
129131 }
130132
131- function test_selfXCC_RevertWhen_Always () public {
132- vm.expectRevert (IInitiator.SelfXCCNotImplemented.selector );
133- harness.selfXCC ();
133+ function test_selfXCC_ReturnsCorrectData () public view {
134+ string memory expectedTypeURL = "/cross.core.xcc.ChannelInfo " ;
135+ bytes memory expectedValue = ChannelInfo.encode (ChannelInfo.Data ({port: "" , channel: "" }));
136+
137+ QuerySelfXCCResponse.Data memory resp = harness.selfXCC ();
138+
139+ assertEq (resp.xcc.type_url, expectedTypeURL, "type_url mismatch " );
140+ assertEq (resp.xcc.value, expectedValue, "value mismatch " );
134141 }
135142
136143 function test_initiateTx_SucceedsAsPendingWhenSignersNotMet () public {
0 commit comments