You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
The terminateChain method of the interoperability module always fails. The terminateChain method uses the getTerminatedStateAccount function to determine if the chain is already terminated, in which case it returns early. If getTerminatedStateAccount returns a falsy value (e.g., undefined), then it terminates the chain by calling the sendInternal method with CROSS_CHAIN_COMMAND_CHANNEL_TERMINATED.
However, getTerminatedStateAccount throws a NotFoundError exception when the chain is not present in the TerminatedStateStore, which causes the terminateChain method to bubble up the exception, meaning that sendInternal is never called.
The existing test cases do not catch this issue because the getTerminatedStateAccount is mocked in a way that does not reflect the correct behavior of that function
Description
The
terminateChain
method of theinteroperability
module always fails. TheterminateChain
method uses thegetTerminatedStateAccount
function to determine if the chain is already terminated, in which case it returns early. IfgetTerminatedStateAccount
returns a falsy value (e.g., undefined), then it terminates the chain by calling thesendInternal
method withCROSS_CHAIN_COMMAND_CHANNEL_TERMINATED
.However,
getTerminatedStateAccount
throws aNotFoundError
exception when the chain is not present in theTerminatedStateStore
, which causes theterminateChain
method to bubble up the exception, meaning thatsendInternal
is never called.https://github.com/LiskHQ/lisk-sdk/blob/89e7504ef5eb6183aefe576a93be3d6052e56038/framework/src/modules/interoperability/base_interoperability_method.ts#L87-L89
https://github.com/LiskHQ/lisk-sdk/blob/89e7504ef5eb6183aefe576a93be3d6052e56038/framework/src/modules/interoperability/base_interoperability_method.ts#L168-L186
The existing test cases do not catch this issue because the
getTerminatedStateAccount
is mocked in a way that does not reflect the correct behavior of that functionhttps://github.com/LiskHQ/lisk-sdk/blob/89e7504ef5eb6183aefe576a93be3d6052e56038/framework/test/unit/modules/interoperability/method.spec.ts#L520-L524
Acceptance Criteria
getTerminatedStateAccount
The text was updated successfully, but these errors were encountered: