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

refactor(plugin-htlc-eth-besu): stop using the deprecated api.encodePacked #2538

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

RafaelAPB
Copy link
Contributor

  1. Add tests to vanilla HashTimeLock
  2. Replace abi.encodePacked by abi.encode
  3. Compile and replace generated ABIs (for HashTimeLock and PrivateHashTimeLock)

Addresses #2531
cc @petermetz

Copy link
Member

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@RafaelAPB LGTM but could you please recompile the contracts with https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity so that the .json artifacts structure is not changed at the same time?

Copy link
Member

@takeutak takeutak left a comment

Choose a reason for hiding this comment

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

LGTM but please refer Peter's comment.

@jagpreetsinghsasan
Copy link
Contributor

LGTM (Peter has already approved to not approving it, as we need 3 approvals from different orgs)

@petermetz petermetz force-pushed the refactor-2531 branch 3 times, most recently from f0a4fbd to fc1dd62 Compare July 24, 2023 07:24
…acked

1. Add tests to vanilla HashTimeLock
2. Replace abi.encodePacked by abi.encode
3. Compile and replace generated ABIs (for HashTimeLock and PrivateHashTimeLock)

Peter's additional changes:
1. Replace all the function calls that were missed.
2. Also update the hash function from sha256 to keccak256 where it was missed
3. Recompile the contracts again but with the VScode extension that gives them
the additional properties with their metadata like the contract name that we
use during deployment.
4. Modify the test case so that it computes the hash for the contract ID
purely in Javascript instead of doing a call to the EVM to do the same.

Co-authored-by: Peter Somogyvari <peter.somogyvari@accenture.com>

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
@petermetz petermetz merged commit dc85c27 into hyperledger:main Jul 24, 2023
106 of 117 checks passed
@RafaelAPB
Copy link
Contributor Author

@petermetz thank you for updating the contracts!

@RafaelAPB RafaelAPB deleted the refactor-2531 branch January 24, 2024 12:45
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.

4 participants