-
Notifications
You must be signed in to change notification settings - Fork 575
refactor: returning last used tagging index #17534
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
refactor: returning last used tagging index #17534
Conversation
| recipient.address, | ||
| ), | ||
| ), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will get reworked in a followup PR were I will implement the solution of tracking finalized indexed etc. so would not care too much about this being nice and clear.
485e42f to
55a5541
Compare
| contractAddress: AztecAddress, | ||
| recipient: AztecAddress, | ||
| ): Promise<IndexedTaggingSecret[]> { | ||
| ): Promise<{ secret: DirectionalAppTaggingSecret; index: number | undefined }[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an ugly change but in a followup PR I will basically delete all the tagging sync and do it again so please tolerate.
| public async syncTaggedLogsAsSender( | ||
| secret: DirectionalAppTaggingSecret, | ||
| contractAddress: AztecAddress, | ||
| ): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will rewrite this insanity and move it to a different file in a followup PR so wouldn't care about code quality here now.
| */ | ||
| export function getInitialIndexesMap(indexedTaggingSecrets: IndexedTaggingSecret[]): { | ||
| export function getInitialIndexesMap( | ||
| indexedTaggingSecrets: { secret: DirectionalAppTaggingSecret; index: number | undefined }[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before, this became ugly with the change but I will just delete this in a followup PR.
b3b8c16 to
3b0d5e2
Compare
fd39b63 to
cd31177
Compare
cd31177 to
bad2246
Compare
3b0d5e2 to
9f97dee
Compare
| Object.entries(newLargestIndexMapToStore).map(([directionalAppTaggingSecret, index]) => ({ | ||
| secret: DirectionalAppTaggingSecret.fromString(directionalAppTaggingSecret), | ||
| index, | ||
| index: index - 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna trust you on this one, because this method got kinda insane
Thunkar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eagerly waiting for the next iteration

As discussed in a PR down the stack returning the next tagging index in various places of tagging was confusing and it's better to return the last used one. In this PR I do this change.
Some of the code is quite weird but I think it doesn't make sense to invest time in that as I will replace all the tagging sync it all in followup PRs.