avalanchego
avalanchego copied to clipboard
Restructured fee calculator API
Why this should be merged
platformvm/txs/fee
package will be extended to include a dynamic fee calculator. This PR restructure the fee calculator package and APIs to prepare for the changes
How this works
- Introduce a
fee.CalculatorAPI
struct, to be used by clients and afee.backend
interface to be implemented by calculators (currentlystaticCalculator
, soondynamicCalculator
as well) - Modify
CalculateFee
attribute to pick only unsignedTx and credentials as parameters. Currently chainTime is a parameters as well, but that won't be needed for the dynamic calculator, hence it has been moved to the constructor
How this was tested
CI