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: MsgInstallBundle indexing #27

Merged
merged 3 commits into from
Jun 14, 2024
Merged

Conversation

frazarshad
Copy link
Collaborator

This PR adds indexing for MsgInstallBundle messages
image

Compare data in picture against this transaction

@frazarshad frazarshad changed the title Feat/bundle install indexing Feat: MsgInstallBundle indexing Jun 13, 2024

await bundleRecord.save();
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should wrap this section of the code in a try-catch block to catch and log any errors that may occur.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

catching the error would result in skipping this message entirely. Throwing an error allows the indexing to stop at that point.
that is our current implementation for all of our functions

return address;
};

export const getAddressFromUint8Array = (uint8Array: Array<number>, chainPrefix: string = 'agoric') => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use the Uint8Array type,

export const getAddressFromUint8Array = (uint8Array: Uint8Array, chainPrefix: string = 'agoric') => {

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you change the type, you will need to make this change on line 106:

  const shaHashUint8Array = new Uint8Array(shaHash.slice(0, 20));
  const address = getAddressFromUint8Array(shaHashUint8Array);

Copy link
Collaborator

@rabi-siddique rabi-siddique Jun 14, 2024

Choose a reason for hiding this comment

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

PS: I haven't tested the functionality implemented in this PR. Just changed the code and there were no compilation errors.

@frazarshad frazarshad merged commit 6d29d5d into main Jun 14, 2024
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