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

feat: Implement store model #51

Merged
merged 17 commits into from
Jan 5, 2023
Merged

feat: Implement store model #51

merged 17 commits into from
Jan 5, 2023

Conversation

yanguoyu
Copy link
Contributor

  1. JSON storage
  2. Pattern define
  3. Store implement

Copy link
Contributor

@PainterPuppets PainterPuppets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually the serialization will have a validation solution, Store will have a similar solution?

@yanguoyu
Copy link
Contributor Author

yanguoyu commented Dec 7, 2022

a validation solution

Can you take an example?

@PainterPuppets
Copy link
Contributor

a validation solution

Can you take an example?

sorry, point wrong

serialization of nest https://docs.nestjs.com/techniques/serialization https://github.com/typestack/class-validator

.eslintrc.js Show resolved Hide resolved
packages/models/src/contract/index.ts Outdated Show resolved Hide resolved
packages/models/src/contract/index.ts Outdated Show resolved Hide resolved
packages/models/src/exceptions/store.ts Outdated Show resolved Hide resolved
packages/models/src/store/chain-storage.ts Outdated Show resolved Hide resolved
packages/models/src/store/chain-storage.ts Outdated Show resolved Hide resolved
packages/models/src/store/json-storage.ts Outdated Show resolved Hide resolved
packages/models/src/store/json-storage.ts Outdated Show resolved Hide resolved
packages/models/src/store/json-storage.ts Outdated Show resolved Hide resolved
packages/models/src/store/json-storage.ts Outdated Show resolved Hide resolved
packages/models/src/store/json-storage.ts Outdated Show resolved Hide resolved
packages/models/src/store/store.ts Outdated Show resolved Hide resolved
packages/models/src/store/store.ts Outdated Show resolved Hide resolved
@yanguoyu
Copy link
Contributor Author

a validation solution

Can you take an example?

sorry, point wrong

serialization of nest https://docs.nestjs.com/techniques/serialization https://github.com/typestack/class-validator

Actual, it has valid the params for serialize and deserialize, and I add some test cases for it with b51e1f6.

@Keith-CY Keith-CY added the enhancement New feature or request label Dec 13, 2022
@Keith-CY Keith-CY added this to the 2022/12/01 - 2022/12/08 milestone Dec 13, 2022
@yanguoyu yanguoyu marked this pull request as draft December 26, 2022 03:07
@yanguoyu yanguoyu marked this pull request as ready for review December 26, 2022 08:19
@yanguoyu yanguoyu requested review from Daryl-L and zhengjianhui and removed request for felicityin December 26, 2022 08:34
packages/models/src/exceptions/store.ts Outdated Show resolved Hide resolved
packages/models/src/store/store.ts Outdated Show resolved Hide resolved
@Daryl-L
Copy link
Contributor

Daryl-L commented Dec 29, 2022

I have a question, how can I instance the Store object from database, by using type script or lock script or both?

@Keith-CY
Copy link
Member

I have a question, how can I instance the Store object from database, by using type script or lock script or both?

Store is a mapping of cells specified by pattern, pattern is a combination of conditions as SQL(designed in #2 (comment)), e.g. lock.code_hash eq A and lock.hash_type eq B and lock.args eq C and type.code_hash eq D and type.hash_type eq F and type.args eq G and data like '%H%'

@Keith-CY
Copy link
Member

We will review this PR later because manipulation on type script and lock script is going to be implemented along with this feature.

Ref: #41 (comment)

@yanguoyu
Copy link
Contributor Author

lock and type schema have been added. @Keith-CY @Daryl-L @zhengjianhui @PainterPuppets

@Keith-CY
Copy link
Member

Keith-CY commented Jan 5, 2023

Here're 2 approvals so this PR is ready to merge once conflicts are resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants