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

Unit test review: Interoperability genesis state initialization/finalization #8378

Closed
Tracked by #7245
gkoumout opened this issue Apr 20, 2023 · 0 comments
Closed
Tracked by #7245
Assignees
Milestone

Comments

@gkoumout
Copy link

Unit test review for interoperability genesis state initialization and finalization steps.

NOTE: Review done on April 20, plz make sure that you check the correct version during addressing the review.

base_interoperability_module.spec.ts

  • verifyTerminatedStateAccountsCommon(), missing test: Check that function verifyChainID() is called same number of times as the size of terminatedStateAccounts array. Also, I think tests for verifyChainID() function are missing.

mainchain/module.spec.ts

  • initGenesisState() unit tests: The checks for that all entries in chainInfos have unique chainID and they are sorted lexicographically by chainID (lines 144 and 157 at current version) should be moved to the unit tests of function verifyChainInfos (which are currently missing). Moreover, missing test that should also be part of verifyChainInfos test, that among all elements of chainInfos, values of chainData.name are pairwise distinct.
  • Similar to the previous comment, I think checks about chainInfo.chainData (line 217 - 302) could be moved to dedicated tests about function verifyChainData, but this I guess is matter of choice. All related tests seem to be included.
  • Similarly, tests for terminatedStateAccounts (lines 304 - 546) essentially correspond to tests for function verifyTerminatedStateAccounts. Missing test to check that function verifyTerminatedStateAccountsCommon is called the proper amount of times.
  • Similarly, tests for terminatedOutboxAccounts (lines 548 - 660) essentially correspond to tests for function verifyTerminatedOutboxAccounts.
  • initGenesisState(): Missing tests: check that functions verifyChainInfos, verifyTerminatedStateAccounts, verifyTerminatedOutboxAccounts and processGenesisState are called.
  • Missing test for processGenesisState (line 663): check that corresponding entries are created in the registered names substore.

sidechain/module.spec.ts

  • Missing tests for verifyChainInfos: Check that it calls the functions verifyChannelData and verifyChainValidators.
  • Missing test for verifyTerminatedStateAccounts: Check that the function verifyTerminatedStateAccountsCommon is called.
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