312 use stellar fee statistics to derive transaction fee #474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #312
General overview of the changes:
DEFAULT_STROOP_FEE_PER_OPERATION
constant in production code.stroop_fee_per_operation
parameters on methodfn send_to_address()
; sincefn get_fee_stats()
todo: only memoize forOk()
results.How to begin the review:
clients/wallet/src/types.rs
-> has theFeeAttribute
enum, where you can pick which one to base the operation onclients/wallet/src/horizon/responses.rs
-> Defining the response into a struct ofFeeStats
andFeeDistribution
clients/wallet/src/horizon/serde.rs
-> Implements deserialization of the fields inFeeStats
andFeeDistribution
to u32clients/wallet/src/horizon/traits.rs
-> add another method to the trait:fn get_fee_stats()
and should return the structFeeStats
clients/wallet/src/horizon/horizon.rs
-> implementsfn get_fee_stats()
clients/wallet/src/horizon/tests.rs
-> testing the methodfn get_fee_stats()
clients/wallet/src/stellar_wallet.rs
fn get_fee()
is introduced, with caching:fn get_fee()
is called insidefn send_to_address(...)
, removing thestroop_fee_per_operation
paramfn send_to_address(...)
will not need to pass astroop_fee_per_operation