iroha icon indicating copy to clipboard operation
iroha copied to clipboard

revise query API on client

Open mversic opened this issue 1 year ago • 2 comments

          I don't like it that on the http client we have API like `asset::all_definitions()`. Because it differs from what we have in smart contracts. IMO there is nothing wrong in constructing a query like this:
    let vec = client
        .query(FindAllAssetDefinitions::new())

Definitely not intended for this PR, but would like to get an opinion on this

Originally posted by @mversic in https://github.com/hyperledger/iroha/pull/4833#discussion_r1684052028

mversic avatar Jul 25 '24 08:07 mversic

in any case API should be the same in client and smart contract

mversic avatar Jul 25 '24 08:07 mversic

I don't see much usability in this module-based client construction, to be honest. Using structures like FindPeers is direct and easy enough, all names are unified, and IDE suggests them straight away.

Apart from that, I want to emphasise again the importance of having an async client (#3130). Current design of QueryBuilder is limited to sync QueryExecutor trait. Due to that, I had to re-implement a slice of client from scratch (https://github.com/soramitsu/iroha2-block-explorer-backend/blob/9d0a77161bf17336b307ee83fe77e8f91bb8704d/src/iroha.rs).

0x009922 avatar Oct 07 '24 08:10 0x009922

I would like to work on this issue.

aoyako avatar Oct 22 '24 09:10 aoyako