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

fix: ibc metadata fetch error handling #396

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 0 additions & 4 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 'Commit ibcTokenMetadata.json if changed'
run: |
git diff --exit-code -- packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json || (git add packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json && git commit -m "Automatically update ibcTokenMetadata.json")

- name: Version and publish
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get IBC Tokens
run: yarn --cwd packages/sdk-ui-ts get-ibc-tokens || true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the || true will make the build continue even if error occurs when running get-ibc-tokens script


- name: 'Commit ibcTokenMetadata.json if changed'
run: |
git diff --exit-code -- packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json || (git add packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json && git commit -m "Automatically update ibcTokenMetadata.json")
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 'Commit ibcTokenMetadata.json if changed'
run: |
git diff --exit-code -- packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json || (git add packages/sdk-ui-ts/src/services/ibc/ibcTokenMetadata.json && git commit -m "Automatically update ibcTokenMetadata.json")

- name: Version and publish
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion packages/sdk-ui-ts/src/services/ibc/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ type IbcTokenMetadata = {
isTrading: boolean
}

const ibcTokenMetadataApi = new HttpRestClient('https://api.tfm.com/api/v1/')
const ibcTokenMetadataApi = new HttpRestClient('https://api.tfm.com/api/v1/', {
timeout: 2000,
})

const TOKEN_METADATA_PATH = 'ibc/chain/injective-1/tokens'

Expand Down