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] #1982: encapsulate access to iroha_crypto structures #2077

Merged

Conversation

mversic
Copy link
Contributor

@mversic mversic commented Apr 8, 2022

Signed-off-by: Marin Veršić [email protected]

Description of the Change

  • encapsulate crypto api
  • move torii related code from core to cli
  • remove warp dependency from core
  • move MerkleTree to iroha_crypto

Issue

Also closes #2101

Benefits

Possible Drawbacks

Usage Examples or Tests [optional]

Alternate Designs [optional]

@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Apr 8, 2022
@mversic mversic changed the title [refactor] #1982: encapsulate access to hash, private key, public key, permission token [refactor] #1982: encapsulate access to iroha_crypto structures Apr 8, 2022
@mversic mversic force-pushed the data_model_encapsulation2 branch 5 times, most recently from 94b69d9 to 979a458 Compare April 12, 2022 06:57
crypto/src/lib.rs Outdated Show resolved Hide resolved
data_model/src/merkle.rs Outdated Show resolved Hide resolved

impl Hash {
/// Length of hash
pub const LENGTH: usize = 32;

/// Construct zeroed hash
pub const fn zeroed() -> Self {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should either have this associated method return all 0 hash as it currently is, or remove it and use Option::None

Copy link
Contributor

@appetrosyan appetrosyan Apr 13, 2022

Choose a reason for hiding this comment

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

Option::None is more idiomatic and doesn't take up more space, if we to mark the hash as non-zero, to enable the niche optimisation.

client/tests/integration/roles.rs Show resolved Hide resolved
data_model/src/permissions.rs Show resolved Hide resolved
docs/source/references/config.md Outdated Show resolved Hide resolved
docs/source/references/config.md Outdated Show resolved Hide resolved
crypto/src/hash.rs Outdated Show resolved Hide resolved
@mversic mversic mentioned this pull request Apr 13, 2022
@mversic mversic force-pushed the data_model_encapsulation2 branch 3 times, most recently from 2cff835 to 4905e4e Compare April 14, 2022 07:02
appetrosyan
appetrosyan previously approved these changes Apr 14, 2022
@hyperledger-iroha hyperledger-iroha deleted a comment from s8sato Apr 18, 2022
@mversic mversic force-pushed the data_model_encapsulation2 branch 2 times, most recently from e9ced83 to fd45932 Compare April 18, 2022 10:22
client/src/config.rs Outdated Show resolved Hide resolved
@mversic mversic force-pushed the data_model_encapsulation2 branch 2 times, most recently from 9f774d6 to c638287 Compare April 18, 2022 11:46
data_model/Cargo.toml Outdated Show resolved Hide resolved
crypto/src/hash.rs Show resolved Hide resolved
crypto/src/hash.rs Show resolved Hide resolved
core/src/sumeragi/config.rs Outdated Show resolved Hide resolved
@mversic mversic force-pushed the data_model_encapsulation2 branch from c638287 to 3563569 Compare April 18, 2022 12:01
@mversic mversic force-pushed the data_model_encapsulation2 branch from 3563569 to 8b8c3c8 Compare April 18, 2022 12:04
@mversic mversic force-pushed the data_model_encapsulation2 branch from 8b8c3c8 to 59412d6 Compare April 18, 2022 12:35
@mversic mversic requested a review from appetrosyan April 18, 2022 14:14
@appetrosyan appetrosyan merged commit 42e9282 into hyperledger-iroha:iroha2-dev Apr 19, 2022
@mversic mversic deleted the data_model_encapsulation2 branch April 19, 2022 08:10
mversic added a commit to mversic/iroha that referenced this pull request May 2, 2022
appetrosyan pushed a commit to appetrosyan/iroha that referenced this pull request May 4, 2022
appetrosyan pushed a commit to appetrosyan/iroha that referenced this pull request May 12, 2022
appetrosyan pushed a commit to appetrosyan/iroha that referenced this pull request May 12, 2022
appetrosyan pushed a commit to appetrosyan/iroha that referenced this pull request May 12, 2022
appetrosyan pushed a commit to appetrosyan/iroha that referenced this pull request May 12, 2022
appetrosyan pushed a commit to appetrosyan/iroha that referenced this pull request May 12, 2022
mversic added a commit to mversic/iroha that referenced this pull request May 13, 2022
mversic added a commit to mversic/iroha that referenced this pull request May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants