Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Duplicate implementation of functionality. #8511

Closed
Tracked by #7226
ishantiw opened this issue May 30, 2023 · 0 comments
Closed
Tracked by #7226

Duplicate implementation of functionality. #8511

ishantiw opened this issue May 30, 2023 · 0 comments
Assignees
Milestone

Comments

@ishantiw
Copy link
Contributor

Description

The interoperability module calculates a CCM ID by encoding the CCM and hashing the result. The code hard codes this in multiple parts of the code instead of implementing it in a single-centralized function. This code is repeated in,
https://github.com/LiskHQ/lisk-sdk/blob/89e7504ef5eb6183aefe576a93be3d6052e56038/framework/src/modules/interoperability/mainchain/commands/submit_mainchain_cross_chain_update.ts#L138
https://github.com/LiskHQ/lisk-sdk/blob/89e7504ef5eb6183aefe576a93be3d6052e56038/framework/src/modules/interoperability/mainchain/commands/recover_message.ts#L410
https://github.com/LiskHQ/lisk-sdk/blob/89e7504ef5eb6183aefe576a93be3d6052e56038/framework/src/modules/interoperability/mainchain/commands/recover_message.ts#L188

Instead, the getEncodedCCMAndID function could be used. Alternatively, another function that just calculates the ID from the encoded CCM could also be created.

Which version(s) does this affect? (Environment, OS, etc...)

v6.0.0-beta.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants