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] Schema: Add tests for MaxEncodedSchemaLimitExceeded #312

Open
3 tasks
vatsa287 opened this issue Feb 6, 2024 · 6 comments
Open
3 tasks

[C4GT] Schema: Add tests for MaxEncodedSchemaLimitExceeded #312

vatsa287 opened this issue Feb 6, 2024 · 6 comments
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-schema after adding it in the code.

Goals

  • Add tests for MaxEncodedSchemaLimitExceeded for pallet/schema

Expected Outcome

  • Test should assert for MaxEncodedSchemaLimitExceeded 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 check_duplicate_schema_creation which validates error code SchemaAlreadyAnchored

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]

@shashank-iitbhu
Copy link
Contributor

I don't think it is possible to create a schema exceeding MaxEncodedSchemaLength and pass it to the create function.
The InputSchemaOf<T> type is defined as a BoundedVec<u8, <T as Config>::MaxEncodedSchemaLength>, which means it is inherently limited to a maximum size specified by MaxEncodedSchemaLength.

So I don't think there is a need to write an explicit test for this. What do you say? or am i missing something?
@vatsa287

@shriyanyk
Copy link

Hi i would like to work on this issue.

@Pankajjsuthar
Copy link

Hi, I was currently working on this issue and find out that "schema size should be max of MaxEncodedSchemaLength and that we are getting as an input and we have to make tests which make sure that schema doesn't exceed the limit" am I right here or am i missing some details here. Can you please tell me more so that I can work on these issues, I think there are 10 in same way, so if I do one in good manner others will be easier for me.

@zeel991
Copy link
Contributor

zeel991 commented Apr 28, 2024

Hey @Pankajjsuthar , as you can see there is already a PR linked to the issue, so you can work on different issue

@VedantKhairnar
Copy link

Hello @Pankajjsuthar Are you open to working on this issue?
We will be happy to assign it to you now.
Thanks.

@Vaibhavsahu2810
Copy link

Vaibhavsahu2810 commented Nov 14, 2024

Hello @vatsa287 @VedantKhairnar i see that this issue has no activity for quite a while. If it's alright, i would like to work on this issue.So,please assign this issue to me.

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

No branches or pull requests

7 participants