-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add Test_GetChainFeePriceUpdates #15240
Conversation
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
Flaky Test Detector for
|
contracts/.changeset/odd-maps-fry.md
Outdated
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.
nit: not needed.
evmconfig "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm" | ||
|
||
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/fee_quoter" |
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.
goimports
@@ -47,6 +51,10 @@ const ( | |||
chainD = cciptypes.ChainSelector(4) | |||
) | |||
|
|||
var ( | |||
defaultGasPrice = big.NewInt(1e9) |
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.
Use assets.GWei
instead
[]fee_quoter.FeeQuoterTokenTransferFeeConfigArgs{}, | ||
[]fee_quoter.FeeQuoterPremiumMultiplierWeiPerEthArgs{ | ||
{ | ||
PremiumMultiplierWeiPerEth: 9e17, // 0.9 ETH |
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.
I think this means 90% and not 0.9ETH cc @0xnogo
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.
i.e a 10% discount
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.
@makramkd I think you are referring to the gasMultiplierWeiPerEth
. But here it's the PremiumMultiplierWeiPerEth
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.
I think this one is set to pay 10% if you are paying with Link token. I think it needs to have 1e18 unit, so what we have here is correct:
// Calculate number of fee tokens to charge.
// Total USD fee is in 36 decimals, feeTokenPrice is in 18 decimals USD for 1e18 smallest token denominations.
// Result of the division is the number of smallest token denominations.
return ((premiumFee * s_premiumMultiplierWeiPerEth[message.feeToken]) + executionCost + dataAvailabilityCost)
/ feeTokenPrice;
executionCost + dataAvailabilityCost => e36
premium (e18) * s_premiumMultiplierWeiPerEth[message.feeToken] (e18) => e36
@@ -2,6 +2,7 @@ package ccipreader | |||
|
|||
import ( | |||
"context" | |||
|
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.
Get rid of newline
* Add Test_GetChainFeePriceUpdates (#15240) Add Test_GetChainFeePriceUpdates * Bind real contracts per chain in CCIPReader test (#15282) Add functionality to bind more contracts to different chains (using same simulated backend for simplicity) in ccipreader tester. LinkPriceUSD test GetMedianDataAvailabilityGasConfig * Test_GetWrappedNativeTokenPriceUSD (#15316) Test_GetWrappedNativeTokenPriceUSD * comments
No description provided.