hyperledger / iroha

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

[refactor]: Change code organization in `iroha_client_cli` #3611

Open Erigara opened 1 year ago

Erigara commented 1 year ago

Btw, it seems that context is used only within submit and listen functions. So, maybe you can define a "miniclient" struct that has submit and listen functions, and does the printing internally?

trait MiniClient {
  fn listen(&mut self, height: NonZeroU64) -> Result<()>;

  fn submit(&mut self, isi: impl Into<Executable>, metadata: UnlimitedMetadata) -> Result<()>;
}

RunArgs might work with MiniClient trait. The struct that implements MiniClient might contain both configuration and debugging logic, which RunArgs does not care about.

_Originally posted by @0x009922 in https://github.com/hyperledger/iroha/pull/3608#discussion_r1230562370_

mversic commented 8 months ago

@0x009922 is this still relevant?