Skip to content
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

[CCIP-2958] Token price reader implementation #67

Merged
merged 22 commits into from
Aug 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7a78a26
WIP new token price reader
asoliman92 Aug 14, 2024
b324085
Bind first token aggregator to price reader
asoliman92 Aug 14, 2024
a64c23b
Moving price reader binding to chainlink inprocess.go and removing fr…
asoliman92 Aug 14, 2024
f942eea
Calculate USD price per 1e18 of smallest token denomination with 18 d…
asoliman92 Aug 15, 2024
6829d88
Fix call to GetLatestValue
asoliman92 Aug 15, 2024
2b55c95
Merge branch 'ccip-develop' into price-reader
asoliman92 Aug 15, 2024
9c4952d
Add decimals to offchain config
asoliman92 Aug 16, 2024
dc73503
Use TokenDecimals in on chain reader
asoliman92 Aug 19, 2024
19851b0
Normalize raw token prices
asoliman92 Aug 19, 2024
8bcd098
Validate all tokens has decimals in offchain config
asoliman92 Aug 19, 2024
691c7a6
Add comments
asoliman92 Aug 19, 2024
cf816e6
Merge branch 'ccip-develop' into price-reader
asoliman92 Aug 19, 2024
c31764c
Add new on chain prices reader to commitocb factory
asoliman92 Aug 19, 2024
2fe0c01
Validate ArbitrumPriceSource in the offchain config
asoliman92 Aug 19, 2024
2bc1395
Add comments
asoliman92 Aug 19, 2024
4e88e66
Merge branch 'ccip-develop' into price-reader
asoliman92 Aug 19, 2024
6ef8ee4
Fix tests - failing because of race condition
asoliman92 Aug 19, 2024
2b33e54
Make the test work with one token as expected
asoliman92 Aug 20, 2024
952025a
Update pluginconfig/commit.go
asoliman92 Aug 20, 2024
1661bba
Update pluginconfig/commit.go
asoliman92 Aug 20, 2024
fad8a3a
review comments
asoliman92 Aug 20, 2024
0f52997
Merge branch 'ccip-develop' into price-reader
asoliman92 Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Validate all tokens has decimals in offchain config
Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com>
  • Loading branch information
asoliman92 committed Aug 19, 2024
commit 8bcd098f91bcab3a4989043a36027a4442739d22
6 changes: 6 additions & 0 deletions pluginconfig/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ func (c CommitOffchainConfig) Validate() error {
c.TokenPriceBatchWriteFrequency, c.TokenPriceChainSelector)
}

for token := range c.PriceSources {
if _, exists := c.TokenDecimals[token]; !exists {
return fmt.Errorf("missing TokenDecimals for account: %s", token)
}
}

// if len(c.PriceSources) == 0 the other fields are ignored.

return nil
Expand Down
Loading