avalanchego icon indicating copy to clipboard operation
avalanchego copied to clipboard

Restructured fee calculator API

Open abi87 opened this issue 8 months ago • 0 comments

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 a fee.backend interface to be implemented by calculators (currently staticCalculator, soon dynamicCalculator 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

abi87 avatar Jun 24 '24 08:06 abi87