hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

Cannot compile `iroha_genesis`: uses private fields from `iroha_data_model` #5049

Closed 0x009922 closed 1 month ago

0x009922 commented 1 month ago

Context

Using iroha_data_model crate as a dependency without transparent_api feature.

Getting these compilation errors from dependent iroha_genesis:

error[E0616]: field `sumeragi` of struct `iroha_data_model::parameter::Parameters` is private
   --> iroha/genesis/src/lib.rs:358:18
    |
358 |         Sumeragi(sumeragi.max_clock_drift_ms) => SumeragiParameter::MaxClockDriftMs,
    |                  ^^^^^^^^ private field

Fix

Add transparent_api feature:

https://github.com/hyperledger/iroha/blob/b4329102eeff4623ea27a23bdc3c86c26ee8a920/genesis/Cargo.toml#L16