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

Path and Identifier validation and improvements #14

Closed
4 of 6 tasks
hu55a1n1 opened this issue Sep 9, 2021 · 1 comment
Closed
4 of 6 tasks

Path and Identifier validation and improvements #14

hu55a1n1 opened this issue Sep 9, 2021 · 1 comment
Labels
good first issue Good for newcomers

Comments

@hu55a1n1
Copy link
Member

hu55a1n1 commented Sep 9, 2021

Description

  • We must also define concretely what an Identifier is and validate it in accordance with ICS024.
  • Path should ideally be a trait. Must provide methods for splitting into component Identifiers, append, etc.
  • Replace basecoin-rs/src/app/store.rs:Identifier::is_valid() with ibc-rs/modules/src/ics24_host/validate.rs:validate_identifier().
  • Reuse ibc-rs/modules/src/ics24_host/identifier.rs:{ChainId, ClientId, *} in basecoin-rs/src/app/modules/ibc.rs.
  • Deserialize paths into concrete ibc-rs/modules/src/ics24_host/path.rs:29.
  • Does it make sense to use const-generics? e.g.
pub struct Identifier<const N: usize>([char; N]);
@hu55a1n1
Copy link
Member Author

hu55a1n1 commented Dec 9, 2021

Regarding Path as a trait, I think it's more intuitive to have a concrete type (i.e. store::Path) that is used as a key for the KV store. Each module may then define its own Path type (expected to be an enum) with all possible paths accessed by the module represented as enum variants. Each module may additionally define conversion methods to/from store::Path.

@hu55a1n1 hu55a1n1 closed this as completed Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant