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(autonomi): expose inner MerkleReg type #2426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

b-zee
Copy link
Contributor

@b-zee b-zee commented Nov 11, 2024

This inner MerkleReg CRDT allows access to the history (DAG) of the register.

@happybeing
Copy link
Contributor

Thanks @b-zee, may I suggest a couple of extras and that you mention the history:

   // Owner's PublicKey is used to verify API calls which are signed using the owner's RegisterSecretKey
    pub fn owner(&self) -> PublicKey {
        self.signed_reg.base_register().address().owner()
    }

    // RegisterPermissions determine who can mutate the register
    pub fn permissions(&self) -> &RegisterPermissions {
        self.signed_reg.base_register().permissions()
    }

   /// Get the low-level CRDT of the register
   /// This is needed to allow access to register history
    pub fn inner_merkle_reg(&self) -> &MerkleReg<Entry> {
        // Unstable method according to documentation.
        &self.crdt_reg.merkle_reg()
    }

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

Successfully merging this pull request may close these issues.

2 participants