Skip to content

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Aug 15, 2024

Why this should be merged

  • Introduces support for dynamic fee txs in the p/staking_rewards and p/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 fix p/workflow.

We now use the pFeeCalculator rather than referencing the hardcoded static fee.

  • Uses less keys in the wallet to fix 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

  • CI

@StephenButtolph StephenButtolph added testing This primarily focuses on testing acp103 labels Aug 15, 2024
@StephenButtolph StephenButtolph added this to the v1.11.11 milestone Aug 15, 2024
@StephenButtolph StephenButtolph self-assigned this Aug 15, 2024
@StephenButtolph StephenButtolph requested a review from marun as a code owner August 15, 2024 00:01
Base automatically changed from dynamic-fees-e2e-testing-cleanup to master August 15, 2024 02:52
@StephenButtolph
Copy link
Contributor Author

Going to merge once CI passes as Aaron approved this change in the prior PR (before it was separated into a different PR)

@StephenButtolph StephenButtolph merged commit 35b58d0 into master Aug 15, 2024
@StephenButtolph StephenButtolph deleted the dynamic-fees-e2e-testing-fix branch August 15, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acp103 testing This primarily focuses on testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants