Follow-up on #286 to implement the threshold strategy to aggregate responses from multiple providers:
Introduce a top-level MultiCallResults::reduce method which takes as parameter a ConsensusStrategy to aggregate the various responses. All existing methods, including eth_fee_history, were refactor to use the new reduce method.
In case of ConsensusStrategy::Threshold, the reduction strategy simply consists of returning the most frequent (non-error) response if it appeared at least the specified threshold number of times.
Refactor MultiCallResults to stored ok results and errors separately.
Follow-up on #286 to implement the threshold strategy to aggregate responses from multiple providers:
MultiCallResults::reduce
method which takes as parameter aConsensusStrategy
to aggregate the various responses. All existing methods, includingeth_fee_history
, were refactor to use the newreduce
method.ConsensusStrategy::Threshold
, the reduction strategy simply consists of returning the most frequent (non-error) response if it appeared at least the specified threshold number of times.MultiCallResults
to stored ok results and errors separately.