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

Removed MerkleValue type #846

Merged
merged 2 commits into from
Dec 13, 2022
Merged

Removed MerkleValue type #846

merged 2 commits into from
Dec 13, 2022

Conversation

batconjurer
Copy link
Member

The design of the merkle tree is that each subtree should handle it's own particulars and the top level storage should be unaware of these details. The MerkleValue type violated this principal by requiring top level storage to correctly cast values to the right type which would then be checked by the sub-trees. This caused bugs and made strained the storage API. This PR removes this type.

@juped
Copy link
Member

juped commented Nov 30, 2022

Yeah, this is a thorn in my side I would be happy to remove

Copy link
Member

@juped juped left a comment

Choose a reason for hiding this comment

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

needs fmt/clippy for new rust (note to myself)

@@ -625,7 +625,7 @@ where
pub fn get_existence_proof(
&self,
key: &Key,
value: MerkleValue,
value: Vec<u8>,
Copy link
Member

Choose a reason for hiding this comment

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

not &[u8]?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure thing

@juped
Copy link
Member

juped commented Nov 30, 2022

i think test-wasm was broken by me, ignore for now

tzemanovic
tzemanovic previously approved these changes Nov 30, 2022
@juped
Copy link
Member

juped commented Dec 2, 2022

pls update wasm

tzemanovic added a commit that referenced this pull request Dec 5, 2022
- remove `MerkleValue` from storage/mod moved to core crate

* bat/remove-merkle-values:
  [fix]: Changed Vec<u8> to &[u8] for getting merkle proofs
  [feat]: Removed MerkleValue type
@tzemanovic tzemanovic mentioned this pull request Dec 5, 2022
juped added a commit that referenced this pull request Dec 13, 2022
juped added a commit that referenced this pull request Dec 13, 2022
* bat/remove-merkle-values:
  changelog: add #846
  [fix]: Changed Vec<u8> to &[u8] for getting merkle proofs
  [feat]: Removed MerkleValue type
@juped juped merged commit 7b50cac into main Dec 13, 2022
@juped juped deleted the bat/remove-merkle-values branch December 13, 2022 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants