Fix e2e tests to support dynamic fees #3296
Merged
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.
Why this should be merged
p/staking_rewards
andp/workflow
tests.How this works
Introduces
e2e.NewPChainFeeCalculatorFromContext
to allow for calculating the expected fee of a transaction (either dynamic or static).Uses
e2e.NewPChainFeeCalculatorFromContext
to fixp/workflow
.We now use the
pFeeCalculator
rather than referencing the hardcoded static fee.p/staking_rewards
.The keychain being passed into the wallet for tx issuance now only has the single funded key.
This doesn't change any behavior for the current test, because we create new wallets for checking balances. However, this change is important with dynamic fees because the transactions that are issued later in the file will produce a change output. The default change output is selected from any of the provided keys (which can break the balance checks).
This isn't a problem in the current test because the static fee for all the Primary Network staking is 0 - which means we never include a change output. This is because the wallet consumes locked UTXOs first for staking operations, and the remaining tokens from those transactions must use the same owner that it was consumed from.
How this was tested