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

Fix Readme #6

Open
qui-jason opened this issue May 3, 2023 · 1 comment
Open

Fix Readme #6

qui-jason opened this issue May 3, 2023 · 1 comment

Comments

@qui-jason
Copy link

qui-jason commented May 3, 2023

Example code doesn't verify key custody/chaining.

This should be added:

            if serder.est()? {
                let digers = if pserder.est()? {
                    pserder.digers()?
                } else {
                    let (event, _) = self.store.get_latest_establishment_event_as_of_sn(&pre, sn as u32 - 1)?;
                    Serder::new_with_raw(event.as_bytes())?.digers()?
                };

                for (i, diger) in digers.iter().enumerate() {
                    if !diger.verify(&verfers[i].qb64b()?)? {
                        return err!(Error::Verification);
                    }
                }
            }
@qui-jason
Copy link
Author

qui-jason commented May 3, 2023

The sn as u32 cast is only a limitation of the underlying datastore, it should be a u128. We have some time before 4 billion events occur I would think, but this is something to be aware of.

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

No branches or pull requests

1 participant