-
Notifications
You must be signed in to change notification settings - Fork 5
Bump cl-common import and update GetFeeQuoterTokenUpdates #190
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
78c9ecd
Bump cl-common import and update CCIPProvider creation
ogtownsend 487ff38
fix: evm offramp in ton provider (#225)
jadepark-dev 5a7f4e4
use const for addr len
ogtownsend 738f0ad
bump cl-common
ogtownsend 572fa9b
Merge branch 'main' into ogt/bump-cl-common-import
ogtownsend 34e3e1e
update vendor hash
ogtownsend 5f88f18
update core version ref
ogtownsend 8caef18
bump cl-ccip with main tag
ogtownsend 0f21fca
check utf8 string in GetFeeQuoterTokenUpdates
ogtownsend a07647b
Merge branch 'main' into ogt/bump-cl-common-import
ogtownsend File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # Notice: `pkgs.lib.fakeHash` can be used as a placeholder, | ||
| # but `nix-lock-tidy` will only replace actual hashes. | ||
| {pkgs}: { | ||
| chainlink-ton = "sha256-NVVBA3iQKCeJbm9r1ndPoD+SH2lZxhY1SiM5S0ElkAw="; | ||
| chainlink-ton = "sha256-chHJ7gzhbzhtBGDxFnq3cGntacHYksVsktF9a+/zCXc="; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import ( | |
| "math/big" | ||
| "sync" | ||
| "time" | ||
| "unicode/utf8" | ||
|
|
||
| "github.com/xssnick/tonutils-go/address" | ||
| "github.com/xssnick/tonutils-go/tlb" | ||
|
|
@@ -717,8 +718,7 @@ func (a *TONAccessor) GetFeedPricesUSD( | |
|
|
||
| func (a *TONAccessor) GetFeeQuoterTokenUpdates( | ||
| ctx context.Context, | ||
| tokens []ccipocr3.UnknownEncodedAddress, | ||
| chain ccipocr3.ChainSelector, | ||
| tokens []ccipocr3.UnknownAddress, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @archseer and @huangzhen1997 for these changes |
||
| ) (map[ccipocr3.UnknownEncodedAddress]ccipocr3.TimestampedUnixBig, error) { | ||
| addr, err := a.getBinding(consts.ContractNameFeeQuoter) | ||
| if err != nil { | ||
|
|
@@ -733,7 +733,15 @@ func (a *TONAccessor) GetFeeQuoterTokenUpdates( | |
|
|
||
| encodedTokens := make([]any, 0, len(tokens)) | ||
| for _, token := range tokens { | ||
| encodedTokens = append(encodedTokens, token) | ||
| strAddr, err2 := a.addrCodec.AddressBytesToString(token) | ||
| if err2 != nil { | ||
| return nil, fmt.Errorf("failed to AddressBytesToString for encodedTokens: %w", err2) | ||
| } | ||
| addrParsed, err2 := address.ParseAddr(strAddr) | ||
| if err2 != nil { | ||
| return nil, fmt.Errorf("failed to ParseAddr %s for encodedTokens: %w", strAddr, err2) | ||
| } | ||
| encodedTokens = append(encodedTokens, addrParsed) | ||
| } | ||
| result, err := a.client.RunGetMethod(ctx, block, addr, "tokenPrices", encodedTokens...) | ||
| // result is a list of TimestampedPrice | ||
|
|
@@ -767,7 +775,10 @@ func (a *TONAccessor) GetFeeQuoterTokenUpdates( | |
| default: | ||
| return nil, fmt.Errorf("expected either cell or nil, received %T", priceResult) | ||
| } | ||
| prices[token] = price | ||
| if !utf8.ValidString(token.String()) { | ||
| return nil, fmt.Errorf("gRPC can't handle non-UTF8 strings: %x", token) | ||
| } | ||
| prices[ccipocr3.UnknownEncodedAddress(token)] = price | ||
| } | ||
| return prices, nil | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.