Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C4GT] Node-Authorization: Add tests for PeerIdTooLong #305

Open
3 tasks
vatsa287 opened this issue Feb 6, 2024 · 6 comments · May be fixed by #499
Open
3 tasks

[C4GT] Node-Authorization: Add tests for PeerIdTooLong #305

vatsa287 opened this issue Feb 6, 2024 · 6 comments · May be fixed by #499
Labels

Comments

@vatsa287
Copy link
Member

vatsa287 commented Feb 6, 2024

Description

Subtask under : cord-network/community#7

New testcase can be tested under cargo test -p pallet-node-authorization after adding it in the code.

Goals

  • Add tests for PeerIdTooLong for pallet/node-authorization

Expected Outcome

  • Test should assert for PeerIdTooLong being returned properly in all the possible calls.
  • If there are more than one function returning this error code, all of them should be validated either as one test case or as multiple test cases.

Acceptance Criteria

NA

Implementation Details

Look at other test cases, and add a test case for the same.
Ex: check method add_well_known_node_works which validates error code NodeIdTooLong

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

Rust

Mentor(s)

@amarts

Complexity

[Medium]

Category

[Test]

Sub Category

[Beginner friendly]

@Jhanvi528
Copy link
Contributor

Hey @vatsa287 sir I would love to work on this project.. Please assign this to me if possible

@urgetolearn
Copy link

Hello @vatsa287 sir, I hope I can work on this project as it matches my skill set can you please assign me this task?

@Abchoudhary2512
Copy link

Hello @vatsa287 sir, can you please assign me this task?

@Almas456
Copy link

Almas456 commented May 3, 2024

Hey @vatsa287 sir, can you pls assign this task to me.

@zeel991 zeel991 linked a pull request Aug 6, 2024 that will close this issue
@VedantKhairnar
Copy link

Hey @zeel991 ,
Can we take this forward?
Thanks.

@vatsa287 vatsa287 changed the title [C4GT] Network-Authorization: Add tests for PeerIdTooLong [C4GT] Node-Authorization: Add tests for PeerIdTooLong Dec 20, 2024
@ritankarsaha
Copy link
Contributor

@vatsa287 the approach to the issue would be to Identify the maximum length constraint for PeerId. Then Review the pallet's implementation to find all functions or extrinsics that could potentially return PeerIdTooLong. Ensuring each function's error path is thoroughly tested eg - add_well_known_node update_node_peer_id
For each function that can return PeerIdTooLong, we can add a corresponding test case:

  1. Setting Up Input: Defining a PeerId longer than the allowed maximum.
  2. Calling the Function: Using the function/extrinsic being tested with the invalid PeerId.
  3. Asserting the Error: Ensuring the function returns the PeerIdTooLong error.

Is this approach correct or do i need to consider something else? Also, I would like to work on this issue.

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

Successfully merging a pull request may close this issue.

7 participants