Skip to content

Commit

Permalink
Add log when allowlist routeID is unset (#10611)
Browse files Browse the repository at this point in the history
* Add log when allowlist routeID is unset

* Added debug log

* Addressed feedback
  • Loading branch information
KuphJr authored Sep 12, 2023
1 parent 7d74c39 commit 73322fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/services/gateway/handlers/functions/allowlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,18 @@ func (a *onchainAllowlist) updateFromContractV1(ctx context.Context, blockNum *b
if err != nil {
return errors.Wrap(err, "unexpected error during functions_router.GetAllowListId")
}
a.lggr.Debugw("successfully fetched allowlist route ID", "id", tosID)
if tosID == [32]byte{} {
return errors.New("allowlist route ID has not been set")
}
tosAddress, err := a.contractV1.GetContractById(&bind.CallOpts{
Pending: false,
Context: ctx,
}, tosID)
if err != nil {
return errors.Wrap(err, "unexpected error during functions_router.GetContractById")
}
a.lggr.Debugw("successfully fetched allowlist contract address", "address", tosAddress)
tosContract, err := functions_allow_list.NewTermsOfServiceAllowList(tosAddress, a.client)
if err != nil {
return errors.Wrap(err, "unexpected error during functions_allow_list.NewTermsOfServiceAllowList")
Expand Down

0 comments on commit 73322fa

Please sign in to comment.