Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Constructor] Suggested Fee Dry Run #144

Merged
merged 7 commits into from
Sep 11, 2020

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Sep 10, 2020

This PR adds support for "dry running" a transaction to get the SuggestedFee without actually signing or broadcasting it. This is useful for amending transactions in UTXO-based blockchains and for ensuring an account has sufficient funds in account-based blockchains.

Changes

  • Add dry_run to Broadcast
  • Add FindCurrencyAmount to actions (need to parse suggested fees)
  • Add Assert to actions where a value can be checked to be positive (otherwise will exit)...ensure we don't create invalid transactions
  • implement Assert
  • implement FindCurrencyAmount
  • implement dry_run
    • existing tests passing

@coveralls
Copy link

coveralls commented Sep 10, 2020

Pull Request Test Coverage Report for Build 6974

  • 85 of 113 (75.22%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 78.123%

Changes Missing Coverage Covered Lines Changed/Added Lines %
constructor/worker/worker.go 37 41 90.24%
fetcher/construction.go 0 5 0.0%
constructor/coordinator/coordinator.go 32 51 62.75%
Totals Coverage Status
Change from base Build 6902: 0.1%
Covered Lines: 5710
Relevant Lines: 7309

💛 - Coveralls

@patrick-ogrady patrick-ogrady merged commit 6946001 into master Sep 11, 2020
@patrick-ogrady patrick-ogrady deleted the patrick/suggested-fee-dry-run branch September 11, 2020 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants