Skip to content

Commit 7078f5d

Browse files
committedFeb 19, 2024
feat: check client status active when verifying membership on tendermint client
1 parent abcb67f commit 7078f5d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
 

‎modules/core/errors/errors.go

+3
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@ var (
6060

6161
// ErrNotFound defines an error when requested entity doesn't exist in the state.
6262
ErrNotFound = errorsmod.Register(codespace, 16, "not found")
63+
64+
// ErrClientStatusNotActive defines an error when an operation expects a client to be active
65+
ErrClientStatusNotActive = errorsmod.Register(codespace, 17, "client is not active")
6366
)

‎modules/light-clients/07-tendermint/client_state.go

+4
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ func (cs ClientState) VerifyMembership(
219219
path exported.Path,
220220
value []byte,
221221
) error {
222+
if cs.Status(ctx, clientStore, cdc) == exported.Expired {
223+
return errorsmod.Wrapf(ibcerrors.ErrClientStatusNotActive, "client status is not active")
224+
}
225+
222226
if cs.GetLatestHeight().LT(height) {
223227
return errorsmod.Wrapf(
224228
ibcerrors.ErrInvalidHeight,

0 commit comments

Comments
 (0)
Please sign in to comment.