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

Added priv_call functionality to generated contract APIs #236

Conversation

niklas-emmelius-mittelstand-ai
  • Retain PrivacyGroupID together with other private transaction fields
  • Switch to priv_call when PrivacyGroupID is passed as query option
  • No PrivacyGroupID generation from PrivateFrom and PrivateFor

- Retain PrivacyGroupID together with other private transaction fields
- Switch to priv_call when PrivacyGroupID is passed as query option
- No  PrivacyGroupID generation from PrivateFrom and PrivateFor

Signed-off-by: Niklas Emmelius <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2023

Codecov Report

Merging #236 (8a93d72) into main (111eb89) will decrease coverage by 0.08%.
Report is 4 commits behind head on main.
The diff coverage is n/a.

❗ Current head 8a93d72 differs from pull request most recent head 4bfef36. Consider uploading reports for the commit 4bfef36 to get more accurate results

@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   97.26%   97.18%   -0.08%     
==========================================
  Files          59       59              
  Lines        7521     7529       +8     
==========================================
+ Hits         7315     7317       +2     
- Misses        163      167       +4     
- Partials       43       45       +2     

see 4 files with indirect coverage changes

Copy link
Contributor

@nguyer nguyer left a comment

Choose a reason for hiding this comment

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

Thanks @niklas-emmelius-mittelstand-ai for contributing this! I'm happy to merge it. Could you please add a unit test that covers the new code? As is, these changes reduce code coverage and we try to make sure it always goes up. Thanks!

- Test calls function callAndProcessReply
- A privacyGroupId is passed in transaction
- Captured rpc method should equal priv_call
- Captured rpc args[0] should equal privacyGroupId

Signed-off-by: Niklas Emmelius <[email protected]>
@niklas-emmelius-mittelstand-ai
Copy link
Author

niklas-emmelius-mittelstand-ai commented Sep 18, 2023

Hi, @nguyer I added a test for the changes. Hopefully coverage should now be unchanged. Let me know if there is anything else to do.

Copy link
Contributor

@nguyer nguyer left a comment

Choose a reason for hiding this comment

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

I am really sorry this one fell off my radar and I didn't see it needed a re-review until now.

@@ -23,6 +23,7 @@ import (
"reflect"
"testing"

"github.com/ethereum/go-ethereum/common/hexutil"
Copy link
Contributor

Choose a reason for hiding this comment

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

Due to the licensing of the github.com/ethereum/go-ethereum we cannot depend on it in any code in this repo.

assert.Equal(t, "HvuYiHoyL31rZ5OYRzSYMGGRV+V8KS4LMuHRfmfDWzg=", rpc.capturedArgs[0])
assert.Equal(t, &SendTXArgs{
From: "0x0000000000000000000000000000000000000000",
Data: &hexutil.Bytes{90, 238, 148, 49},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should be able to change this to &ethbinding.HexBytes and have it work, which will remove the need to pull in github.com/ethereum/go-ethereum

@nguyer
Copy link
Contributor

nguyer commented Feb 15, 2024

Closing this PR due to inactivity. Please feel free to re-open if this work is still ongoing.

@nguyer nguyer closed this Feb 15, 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.

3 participants