Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: kill all warnings #41

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions contracts/clients/CkbClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ contract CkbClient is ILightClient {
* @dev getTimestampAtHeight returns the timestamp of the consensus state at the given height.
*/
function getTimestampAtHeight(
string calldata clientId,
Height.Data calldata height
) external view override returns (uint64, bool) {
string calldata,
Height.Data calldata
) external pure override returns (uint64, bool) {
return (9223372036854775807, true);
}

/**
* @dev getLatestHeight returns the latest height of the client state corresponding to `clientId`.
*/
function getLatestHeight(
string calldata clientId
string calldata
) external pure override returns (Height.Data memory, bool) {
return (Height.Data({revisionNumber: 0, revisionHeight: 9999}), true);
}
Expand All @@ -89,10 +89,11 @@ contract CkbClient is ILightClient {
* 5. persist the state(s) on the host
*/
function updateClient(
string calldata clientId,
bytes calldata clientMessageBytes
string calldata,
bytes calldata
)
external
pure
override
returns (
bytes32 clientStateCommitment,
Expand All @@ -108,15 +109,15 @@ contract CkbClient is ILightClient {
* The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
*/
function verifyMembership(
string calldata clientId,
Height.Data calldata height,
string calldata,
Height.Data calldata,
uint64,
uint64,
bytes calldata proof,
bytes memory,
bytes memory path,
bytes calldata value
) external override returns (bool) {
) external view override returns (bool) {
return CkbProof.verifyProof(proof, path, value);
}

Expand All @@ -125,14 +126,14 @@ contract CkbClient is ILightClient {
* The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
*/
function verifyNonMembership(
string calldata clientId,
Height.Data calldata height,
string calldata,
Height.Data calldata,
uint64,
uint64,
bytes calldata proof,
bytes calldata,
bytes memory,
bytes memory
) external view override returns (bool) {
) external pure override returns (bool) {
return true;
}

Expand All @@ -159,7 +160,7 @@ contract CkbClient is ILightClient {
*/
function getConsensusState(
string calldata clientId,
Height.Data calldata height
Height.Data calldata
) external view returns (bytes memory consensusStateBytes, bool) {
string memory result = string.concat(
clientId,
Expand Down
33 changes: 17 additions & 16 deletions contracts/clients/MockClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ contract MockClient is ILightClient {
* @dev getTimestampAtHeight returns the timestamp of the consensus state at the given height.
*/
function getTimestampAtHeight(
string calldata clientId,
Height.Data calldata height
) external view override returns (uint64, bool) {
string calldata,
Height.Data calldata
) external pure override returns (uint64, bool) {
return (9223372036854775807, true);
}

/**
* @dev getLatestHeight returns the latest height of the client state corresponding to `clientId`.
*/
function getLatestHeight(
string calldata clientId
string calldata
) external pure override returns (Height.Data memory, bool) {
return (Height.Data({revisionNumber: 0, revisionHeight: 9999}), true);
}
Expand All @@ -90,10 +90,11 @@ contract MockClient is ILightClient {
* 5. persist the state(s) on the host
*/
function updateClient(
string calldata clientId,
bytes calldata clientMessageBytes
string calldata,
bytes calldata
)
external
pure
override
returns (
bytes32 clientStateCommitment,
Expand All @@ -109,15 +110,15 @@ contract MockClient is ILightClient {
* The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
*/
function verifyMembership(
string calldata clientId,
Height.Data calldata height,
string calldata,
Height.Data calldata,
uint64,
uint64,
bytes calldata proof,
bytes calldata,
bytes memory,
bytes memory,
bytes calldata value
) external view override returns (bool) {
bytes calldata
) external pure override returns (bool) {
return true;
}

Expand All @@ -126,14 +127,14 @@ contract MockClient is ILightClient {
* The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24).
*/
function verifyNonMembership(
string calldata clientId,
Height.Data calldata height,
string calldata,
Height.Data calldata,
uint64,
uint64,
bytes calldata proof,
bytes calldata,
bytes memory,
bytes memory
) external view override returns (bool) {
) external pure override returns (bool) {
return true;
}

Expand All @@ -160,7 +161,7 @@ contract MockClient is ILightClient {
*/
function getConsensusState(
string calldata clientId,
Height.Data calldata height
Height.Data calldata
) external view returns (bytes memory consensusStateBytes, bool) {
string memory result = string.concat(
clientId,
Expand Down
Loading