Skip to content

feat: updated emit_unencrypted_log with contract address and topic#2582

Closed
benesjan wants to merge 2 commits into
masterfrom
janb/emitting_address_and_topic_from_noir
Closed

feat: updated emit_unencrypted_log with contract address and topic#2582
benesjan wants to merge 2 commits into
masterfrom
janb/emitting_address_and_topic_from_noir

Conversation

@benesjan

@benesjan benesjan commented Sep 28, 2023

Copy link
Copy Markdown
Contributor

Fixes #2580
Fixes #2581

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

// --> might be a better approach to force devs to make a public function call that emits the log if needed then
// it would be less easy to accidentally leak information.
// If we decide to keep this function around would make sense to wait for traits and then merge it with emit_unencrypted_log.
fn emit_unencrypted_log_from_private<T>(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you create this function so that it is easy to identify what to remove if we choose to do so?

@benesjan benesjan Sep 29, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was one of the reasons.

But the main one was that if I wanted to have 1 function for use in both private and public contexts I would have to use the Context wrapper and that seemed like too much of a boilerplate.

I would have to use:
emit_unencrypted_log(Context::public(&mut context), "Coins transferred");
Instead of:
emit_unencrypted_log(&mut context, "Coins transferred");

@benesjan

Copy link
Copy Markdown
Contributor Author

Replaced with #2595

@benesjan benesjan closed this Sep 29, 2023
@benesjan benesjan deleted the janb/emitting_address_and_topic_from_noir branch October 4, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Emit contract address from Noir Emit log topic/event selector from Noir

2 participants