Skip to content

Commit

Permalink
Merge pull request #18 from datachainlab/fix-get-client-state
Browse files Browse the repository at this point in the history
Fix getClientState to return state if latest height is 0

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Jun 18, 2024
2 parents 5ac4e18 + 41f2117 commit 074548f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/LCPClientBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ abstract contract LCPClientBase is ILightClient, ILCPClientErrors {
*/
function getClientState(string calldata clientId) public view returns (bytes memory clientStateBytes, bool) {
ProtoClientState.Data storage clientState = clientStorages[clientId].clientState;
if (clientState.latest_height.revision_height == 0) {
if (clientState.mrenclave.length == 0) {
return (clientStateBytes, false);
}
return (LCPProtoMarshaler.marshal(clientState), true);
Expand Down

0 comments on commit 074548f

Please sign in to comment.