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

Improving address generation #83

Merged
merged 23 commits into from
Oct 19, 2023
Merged

Improving address generation #83

merged 23 commits into from
Oct 19, 2023

Conversation

DariuszDepta
Copy link
Member

@DariuszDepta DariuszDepta commented Oct 11, 2023

closes #66


Key changes

  • extracted the address generator logic to separate module,
  • refactored and improved the interface of AddressGenerator trait,
  • implemented generation of predictable addresses to have a collision for the same salt,
  • added test cases that show how to provide custom Api and custom AddressGenerator that support Bech32 address encoding.

Users may now provide their own AddressGenerator implementation with predictable contract addresses in any address encoding.

@DariuszDepta DariuszDepta self-assigned this Oct 11, 2023
@DariuszDepta DariuszDepta marked this pull request as draft October 11, 2023 15:37
@DariuszDepta DariuszDepta force-pushed the issue-66 branch 2 times, most recently from 4197c11 to 5c05c0c Compare October 17, 2023 09:51
@DariuszDepta DariuszDepta added this to the 0.18.0 milestone Oct 18, 2023
@DariuszDepta DariuszDepta marked this pull request as ready for review October 18, 2023 10:08
Copy link
Contributor

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

Haven't finished yet, but here are some comments already.
I am warming up more to the idea of doing small breaking changes before 1.0

src/addresses.rs Outdated Show resolved Hide resolved
src/error.rs Outdated Show resolved Hide resolved
src/wasm.rs Show resolved Hide resolved
src/wasm.rs Show resolved Hide resolved
src/addresses.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

LGTM now

@DariuszDepta DariuszDepta merged commit 31981c4 into main Oct 19, 2023
7 checks passed
@DariuszDepta DariuszDepta deleted the issue-66 branch October 19, 2023 14:52
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.

Function register_contract in wasm module should behave more like real blockchain
2 participants