dhiway / cord

CORD - Enterprise Blockchain Framework
https://cord.network
GNU General Public License v3.0
160 stars 106 forks source link

[C4GT] Schema: Add tests for `MaxEncodedSchemaLimitExceeded` #312

Open vatsa287 opened 9 months ago

vatsa287 commented 9 months ago

Description

Subtask under : https://github.com/cord-network/community/issues/7

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

Goals

Expected Outcome

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 commented 7 months ago

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 commented 6 months ago

Hi i would like to work on this issue.

Pankajjsuthar commented 6 months ago

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 commented 6 months ago

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

VedantKhairnar commented 2 months ago

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