Skip to content

MerkleTree + too many users #343

@sydhds

Description

@sydhds

Trying to add a new user in pmTree and to check if there are too many users:

match self.merkle_tree.set(new_index, rate_commit) {
  Err(e) => {
    if matches!(e, ZerokitMerkleTreeError::PmtreeErrorKind(PmtreeErrorKind::TreeError(TreeErrorKind::IndexOutOfBounds))) {
      println!("Cannot add more users, merkle tree is full...");
    } else {
      println!("Other error
    }
  },
  _ => todo!(),
}

This is very complicated and rely on PmtreeErrorKind (so this code will fail to compile if we switch to another merkle tree impl).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions