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: add unique id index to lmdb #3407

Conversation

StriderDM
Copy link
Contributor

@StriderDM StriderDM commented Oct 4, 2021

Description

Adds unique_id index to lmdb

cargo fmt

Rebase fixes
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

utAck - so the idea is that the hash preimage is asset namespace/class || the token?

@@ -445,6 +449,16 @@ impl LMDBDatabase {
"utxo_commitment_index",
)?;

if let Some(unique_id) = &output.features.unique_id.clone() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if let Some(unique_id) = &output.features.unique_id.clone() {
if let Some(unique_id) = output.features.unique_id.as_ref() {

@@ -567,6 +581,10 @@ impl LMDBDatabase {
"utxo_commitment_index",
)?;

if let Some(unique_id) = input.features.unique_id.clone() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if let Some(unique_id) = input.features.unique_id.clone() {
if let Some(unique_id) = input.features.unique_id.as_ref() {

@@ -841,6 +859,9 @@ impl LMDBDatabase {
output.commitment.as_bytes(),
"utxo_commitment_index",
)?;
if let Some(unique_id) = output.features.unique_id.clone() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if let Some(unique_id) = output.features.unique_id.clone() {
if let Some(unique_id) = output.features.unique_id.as_ref() {

@delta1
Copy link
Contributor

delta1 commented Oct 4, 2021

utAck - so the idea is that the hash preimage is asset namespace/class || the token?

Sounds right, I think according to proposed RFC (parent_pub_key, unique_id) should be unique

Copy link
Contributor

@delta1 delta1 left a comment

Choose a reason for hiding this comment

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

as per the proposed RFC the key for the index should be parent_public_key || unique_id

@delta1
Copy link
Contributor

delta1 commented Oct 4, 2021

I'm happy to pick this up as part of the validations I'm doing @StriderDM 👍

@delta1
Copy link
Contributor

delta1 commented Oct 5, 2021

Included in #3416 thanks @StriderDM !

@delta1 delta1 closed this Oct 5, 2021
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.

3 participants