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

Add missing unit tests for the PoS Module Validator Registration Command #7873

Closed
Tracked by #7244
mosmartin opened this issue Dec 9, 2022 · 1 comment · Fixed by #8402
Closed
Tracked by #7244

Add missing unit tests for the PoS Module Validator Registration Command #7873

mosmartin opened this issue Dec 9, 2022 · 1 comment · Fixed by #8402
Assignees
Milestone

Comments

@mosmartin
Copy link
Contributor

Description

Based on the defined test cases, the following tests are missing from the implemented unit tests.

  • verify()

    • params.validatorRegistrationFee != VALIDATOR_REGISTRATION_FEE
      • Expectation: Invalid transaction. Throw error at verify step.
    • name is longer than MAX_LENGTH_NAME characters long
      • Expectation: Invalid transaction. Throw error at verify step.
    • name is empty
      • Expectation: Invalid transaction. Throw error at verify step.
    • There exists already an entry in the name substore with store key trs.params.name
      • Expectation: Invalid transaction. Throw error at verify step.
  • execute()

    • Transaction passes verification and registerValidatorKeys function from the Validators module does not throw

Motivation

These test will align with defined test cases and ensure complete coverage of the scenarios.

@mosmartin
Copy link
Contributor Author

For the first test params.validatorRegistrationFee != VALIDATOR_REGISTRATION_FEE it's been covered by the should return error if transaction does not have enough balance for the registration fee test on L302.

For the second test name is longer than MAX_LENGTH_NAME characters long, the impl does not exist and I have created an issue here.

For the fourth test There exists already an entry in the name substore with store key trs.params.name, it's been covered by the should return error if store key name already exists in name store test on L256

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

Successfully merging a pull request may close this issue.

3 participants