TezosKit icon indicating copy to clipboard operation
TezosKit copied to clipboard

[WIP] Simulate / Estimate Fees for a set of operations

Open keefertaylor opened this issue 4 years ago • 2 comments

Addresses #171

keefertaylor avatar Mar 08 '20 18:03 keefertaylor

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@021532a). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #179   +/-   ##
=========================================
  Coverage          ?   55.49%           
=========================================
  Files             ?      100           
  Lines             ?     4125           
  Branches          ?        0           
=========================================
  Hits              ?     2289           
  Misses            ?     1836           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 021532a...5304918. Read the comment docs.

codecov[bot] avatar Mar 08 '20 20:03 codecov[bot]

This looks great. I think you need to expose a FeeEstimator instance from TezosNodeClient so this estimate: [] method can be called without having to instantiate a simulation service and a network client etc. as they are all internal too.

I can't test it properly as I need too much code from my other "orignate_smart-contract" branch

This would be useful as for all of my use cases i've had to stop using the action methods like tezosNodeClient.send(amount: ....) and rely on arrays of operations for everything so I can display confirmation screens. After this it would become much simpler to do

// Generate operations array from tezosNodeClient.operationFactory() // Estimate fees from tezosNodeClient.feeEstimator.estimate( [operations] ) and update screen when done // On confirm, send with tezosNodeClient.send( [operations] )

simonmcl avatar Mar 16 '20 11:03 simonmcl