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-4403 skeleton: LBTC attestation #1554

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
Commits
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
fix ci
  • Loading branch information
bukata-sa committed Nov 29, 2024
commit 01cf18ab2cd2851008632bdd1a88285da70e510f
15 changes: 8 additions & 7 deletions core/services/ocr2/plugins/ccip/tokendata/lbtc/lbtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ type attestationResponse struct {
Attestations []messageAttestationResponse `json:"attestations"`
}

type SourceTokenData struct {
sourcePoolAddress []byte
destTokenAddress []byte
extraData []byte
destGasAmount uint32
}

// TODO: Implement encoding/decoding

var _ tokendata.Reader = &TokenDataReader{}
Expand Down Expand Up @@ -206,6 +199,14 @@ func (s *TokenDataReader) getLBTCMessageBody(ctx context.Context, msg cciptypes.
}

func (s *TokenDataReader) callAttestationApi(ctx context.Context, lbtcMessageHash [32]byte) (attestationResponse, error) {
_, _, _, err := s.httpClient.Get(ctx, "", s.attestationApiTimeout)
switch {
case errors.Is(err, tokendata.ErrRateLimit):
s.setCoolDownPeriod(defaultCoolDownDuration)
return attestationResponse{}, tokendata.ErrRateLimit
case err != nil:
return attestationResponse{}, err
}
return attestationResponse{}, nil
}

Expand Down
Loading