-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix backwards compatibility for tx fee #2257
Fix backwards compatibility for tx fee #2257
Conversation
SebastianMarian
commented
Aug 30, 2020
- Fixed backwards compatibility for calculation of tx fee in "checkTxValues" method from baseTxProcessor and "Fee" method from InterceptedTransaction
…Values" method from baseTxProcessor and "Fee" method from InterceptedTransaction
…tartNotifier object
…tx-fee' into Fix-backwards-compatibility-for-tx-fee
cmd/node/main.go
Outdated
@@ -833,7 +833,11 @@ func startNode(ctx *cli.Context, log logger.Logger, version string) error { | |||
time.Sleep(secondsToWaitForP2PBootstrap * time.Second) | |||
|
|||
log.Trace("creating economics data components") | |||
economicsData, err := economics.NewEconomicsData(economicsConfig) | |||
economicsData, err := economics.NewEconomicsData( | |||
economicsConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add arguments structure instead of list of arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
process/economics/economicsData.go
Outdated
|
||
return gasPrice.Mul(gasPrice, gasLimit) | ||
// EstimateMoveBalanceFee estimates the provided transaction's fee | ||
func (ed *EconomicsData) EstimateMoveBalanceFee(tx process.TransactionWithFeeHandler) *big.Int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong function name - we will get into the same problem later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
process/transaction/baseProcess.go
Outdated
@@ -137,7 +137,7 @@ func (txProc *baseTxProcessor) checkTxValues( | |||
return process.ErrWrongTypeAssertion | |||
} | |||
|
|||
txFee := core.SafeMul(tx.GasLimit, tx.GasPrice) | |||
txFee := txProc.economicsFee.EstimateMoveBalanceFee(tx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ComputeTxFee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…tx-fee' into Fix-backwards-compatibility-for-tx-fee # Conflicts: # cmd/node/main.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.