Reuse one SubxtChainClient struct that implements all chain client traits in provider-node#159
Reuse one SubxtChainClient struct that implements all chain client traits in provider-node#159franciscoaguirre wants to merge 3 commits into
Conversation
| bucket_ids.push(bucket_id); | ||
| } | ||
|
|
||
| if entry_count > 0 { |
There was a problem hiding this comment.
hmm, why not use just bucket_ids.len() here?
entry_count is confusing, it is incremented at the beginning between various continue;, so it is not obvious what entry_count means - success, correct, all, partial?
There was a problem hiding this comment.
I moved this exactly as it was before in order to not change the behavior in any way. I'll make follow-up PRs simplifying the functions themselves
|
@franciscoaguirre please, check also this comment: https://github.com/paritytech/web3-storage/pull/147/changes#r3394340663 - we should check and refactor all the |
|
@bkontur I wanted to keep this PR small and just do this one refactor but I can create a PR on top that tries to reuse client instantiation |
| /// Provider account ID (SS58 encoded) | ||
| pub provider_id: String, | ||
| /// Signing keypair (optional, for dev/testing) | ||
| pub keypair: Option<sr25519::Pair>, |
There was a problem hiding this comment.
Question: Why do we use sp_core::sr25519::Pair here but in challenge_responder, agreemeent_coordinator, replica_sync_coordinator use subxt_signer::sr25519::Keypair ?
I believe we can refactor all to use subxt_signer::sr25519::Keypair so that there will not pub async fn connect(chain_ws_url: &str, seed: &str) or pub async fn connect(chain_ws_url: &str, keypair: &sr25519::Pair)
Keeps the separation of the interfaces but deduplicates code