-
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
Calculate gas for built in functions #2977
Calculate gas for built in functions #2977
Conversation
miiu96
commented
Apr 8, 2021
•
edited
edited
- Calculate the gas cost for built-in functions like ESDT Transfer,ESDT Local Burn,ESDT Local Mint, etc
…ial-built-in-functions
process/economics/interface.go
Outdated
// BuiltInFunctionsCostHandler is able to calculated the cost of a built in function call | ||
type BuiltInFunctionsCostHandler interface { | ||
ComputeBuiltInCost(tx process.TransactionWithFeeHandler) uint64 | ||
IsSpecialBuiltIn(tx process.TransactionWithFeeHandler) bool |
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 IsInterfaceNIl
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.
} | ||
|
||
// IsSpecialBuiltIn will check is the provided transaction is a special build in function call | ||
func (bc *builtInFunctionsCost) IsSpecialBuiltIn(tx process.TransactionWithFeeHandler) bool { |
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.
rename to IsBuiltInFuncCall ?
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.
// IsSpecialBuiltIn - | ||
func (b BuiltInCostHandlerStub) IsSpecialBuiltIn(_ process.TransactionWithFeeHandler) bool { | ||
// IsBuiltInFuncCall - | ||
func (b BuiltInCostHandlerStub) IsBuiltInFuncCall(_ process.TransactionWithFeeHandler) bool { |
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.
can you change to pointer receiver everywhere?
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.
// IsSpecialBuiltIn - | ||
func (b BuiltInCostHandlerStub) IsSpecialBuiltIn(_ process.TransactionWithFeeHandler) bool { | ||
// IsBuiltInFuncCall - | ||
func (b BuiltInCostHandlerStub) IsBuiltInFuncCall(_ process.TransactionWithFeeHandler) bool { |
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.
can you change to pointer receiver everywhere?
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.
(a transaction that does an NFT Transfer will have the "gasUsed" field equal with gas limit) and the remaining gas will be seen in SCR)
…ial-built-in-functions
…ial-built-in-functions
…ial-built-in-functions
…ial-built-in-functions
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 test passed.