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 explorer url #6

Merged
merged 3 commits into from
Dec 11, 2023
Merged

Fix explorer url #6

merged 3 commits into from
Dec 11, 2023

Conversation

cgilbe27
Copy link

@cgilbe27 cgilbe27 commented Dec 11, 2023

Updates URLs

Summary by CodeRabbit

  • New Features

    • Network configurations updated to enhance connectivity and performance.
    • Added new functions for retrieving financial quotes and IBC denominations.
  • Bug Fixes

    • Adjusted URLs for development and test networks to ensure accurate network targeting.
  • Chores

    • Updated deployment workflows with the latest Node.js version and caching strategies.
    • Upgraded Firebase tools to improve deployment processes.
  • Documentation

    • No visible changes to end-users.

@cgilbe27 cgilbe27 requested a review from CalicoNino December 11, 2023 15:03
@cgilbe27 cgilbe27 self-assigned this Dec 11, 2023
Copy link

coderabbitai bot commented Dec 11, 2023

Walkthrough

The updates involve URL adjustments in TypeScript constants, enhancements to a JavaScript store module with new functions and state management for network configurations, and workflow optimizations in GitHub Actions with Node.js and cache version upgrades, as well as specific tool version settings.

Changes

File Path Change Summary
src/nibiru/index.ts Updated URLs for DEV_NETWORKS and ITN_NETWORKS constants.
src/store/chains/index.js Added network config functions, updated state and getters, and implemented new actions.
.github/workflows/.../deploy-preview.yml
.github/workflows/.../deploy-prod.yml
Updated Node.js to 'lts/gallium', cache to 'yarn', and set firebaseToolsVersion to '12.9.1'.

🐇✨
In the code's burrow, beneath the moon's glow,
URLs shift, and workflows flow.
With each commit, the garden grows,
A rabbit's touch, the changelog shows. 🌱🌟

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

sonarcloud bot commented Dec 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

Visit the preview URL for this PR (updated for commit 3ad8f69):

https://nibiru-explorer--pr6-fix-explorer-url-wfhlvrjt.web.app

(expires Mon, 25 Dec 2023 15:14:26 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 0653a911498be5ff7b1517207d84ddca0bcce10b

@cgilbe27 cgilbe27 merged commit 65e1eaa into master Dec 11, 2023
4 checks passed
@cgilbe27 cgilbe27 deleted the fix/explorer-url branch December 11, 2023 15:14
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 13

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 96220a8 and c61a3c2.
Files selected for processing (2)
  • src/nibiru/index.ts (1 hunks)
  • src/store/chains/index.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/nibiru/index.ts
Additional comments: 1
src/store/chains/index.js (1)
  • 151-154: The TextEncoder is used but not imported or defined. Ensure that TextEncoder is available in the runtime environment or import it explicitly.

Comment on lines 19 to 47
try {
const testnets = await fetch(ITN_NETWORKS).then(response => response.json())
testnets.forEach((_, i) => {
testnets[i].visible = true
})
configs.push(...testnets)
} catch (error) {
console.log(error)
}

try {
const devnets = await fetch(DEV_NETWORKS).then(response => response.json())
devnets.forEach((_, i) => {
devnets[i].visible = false
})
configs.push(...devnets)
} catch (error) {
console.log(error)
}

try {
const playnets = await fetch(PLAYGROUND_NETWORKS).then(response => response.json())
playnets.forEach((_, i) => {
playnets[i].visible = false
})
configs.push(...playnets)
} catch (error) {
console.log(error)
}
Copy link

Choose a reason for hiding this comment

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

The await keyword is used outside of an async function, which will cause a syntax error. Wrap the code that uses await with an async function or use .then() for promise handling.

})
configs.push(...testnets)
} catch (error) {
console.log(error)
Copy link

Choose a reason for hiding this comment

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

Consider improving error handling instead of just logging to the console. In a production environment, it's better to handle errors in a way that can be monitored or reported to an error tracking service.

Also applies to: 36-36, 46-46

})

chains = update
localStorage.setItem('chains', JSON.stringify(update))
Copy link

Choose a reason for hiding this comment

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

Direct manipulation of localStorage is found. Consider abstracting local storage access to handle potential key collisions and to make it easier to change storage keys in the future.

Also applies to: 93-93, 106-106

ibcPaths: {},
},
getters: {
getchains: state => state.chains,
Copy link

Choose a reason for hiding this comment

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

The getchains getter is returning state.chains, which is undefined. It should return state.config based on the state definition.

- getchains: state => state.chains,
+ getchains: state => state.config,

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
getchains: state => state.chains,
getchains: state => state.config,

Comment on lines 85 to 117
setup_sdk_version(state, info) {
state.chains.config[info.chain_name].sdk_version = info.version
},
select(state, args) {
state.chains.selected = state.chains.config[args.chain_name]
},
cacheAvatar(state, args) {
state.chains.avatars[args.identity] = args.url
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars))
},
setHeight(state, height) {
state.chains.height = height
},
setChannels(state, { chain, channels }) {
state.chains.ibcChannels[chain] = channels
},
setQuotes(state, quotes) {
state.quotes = quotes
},
setDefaultWallet(state, defaultWallet) {
if (defaultWallet && defaultWallet.length > 0) {
localStorage.setItem('default-wallet', defaultWallet)
state.chains.defaultWallet = defaultWallet
} else {
state.chains.defaultWallet = null
}
},
setIBCDenoms(state, denoms) {
state.denoms = { ...state.denoms, ...denoms }
},
setIBCPaths(state, paths) {
state.ibcPaths = paths
},
Copy link

Choose a reason for hiding this comment

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

The mutations are referencing state.chains, which is not defined in the state. It should be state.config based on the state definition.

Comment on lines 104 to 110
setDefaultWallet(state, defaultWallet) {
if (defaultWallet && defaultWallet.length > 0) {
localStorage.setItem('default-wallet', defaultWallet)
state.chains.defaultWallet = defaultWallet
} else {
state.chains.defaultWallet = null
}
Copy link

Choose a reason for hiding this comment

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

The setDefaultWallet mutation is incorrectly updating state.chains.defaultWallet. It should update state.defaultWallet based on the state definition.

- state.chains.defaultWallet = defaultWallet
+ state.defaultWallet = defaultWallet

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
setDefaultWallet(state, defaultWallet) {
if (defaultWallet && defaultWallet.length > 0) {
localStorage.setItem('default-wallet', defaultWallet)
state.chains.defaultWallet = defaultWallet
} else {
state.chains.defaultWallet = null
}
setDefaultWallet(state, defaultWallet) {
if (defaultWallet && defaultWallet.length > 0) {
localStorage.setItem('default-wallet', defaultWallet)
state.defaultWallet = defaultWallet
} else {
state.defaultWallet = null
}

Comment on lines 98 to 99
setChannels(state, { chain, channels }) {
state.chains.ibcChannels[chain] = channels
Copy link

Choose a reason for hiding this comment

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

The setChannels mutation is incorrectly updating state.chains.ibcChannels. It should update state.ibcChannels based on the state definition.

- state.chains.ibcChannels[chain] = channels
+ state.ibcChannels[chain] = channels

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
setChannels(state, { chain, channels }) {
state.chains.ibcChannels[chain] = channels
setChannels(state, { chain, channels }) {
state.ibcChannels[chain] = channels

Comment on lines 91 to 93
cacheAvatar(state, args) {
state.chains.avatars[args.identity] = args.url
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars))
Copy link

Choose a reason for hiding this comment

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

The cacheAvatar mutation is incorrectly updating state.chains.avatars. It should update state.avatars based on the state definition.

- state.chains.avatars[args.identity] = args.url
+ state.avatars[args.identity] = args.url

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
cacheAvatar(state, args) {
state.chains.avatars[args.identity] = args.url
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars))
cacheAvatar(state, args) {
state.avatars[args.identity] = args.url
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars))

Comment on lines 88 to 89
select(state, args) {
state.chains.selected = state.chains.config[args.chain_name]
Copy link

Choose a reason for hiding this comment

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

The select mutation is incorrectly updating state.chains.selected. It should update state.selected based on the state definition.

- state.chains.selected = state.chains.config[args.chain_name]
+ state.selected = state.config[args.chain_name]

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
select(state, args) {
state.chains.selected = state.chains.config[args.chain_name]
select(state, args) {
state.selected = state.config[args.chain_name]

Comment on lines 85 to 86
setup_sdk_version(state, info) {
state.chains.config[info.chain_name].sdk_version = info.version
Copy link

Choose a reason for hiding this comment

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

The setup_sdk_version mutation is incorrectly updating state.chains.config. It should update state.config based on the state definition.

- state.chains.config[info.chain_name].sdk_version = info.version
+ state.config[info.chain_name].sdk_version = info.version

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
setup_sdk_version(state, info) {
state.chains.config[info.chain_name].sdk_version = info.version
setup_sdk_version(state, info) {
state.config[info.chain_name].sdk_version = info.version

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c61a3c2 and 3ad8f69.
Files selected for processing (2)
  • .github/workflows/deploy-preview.yml (2 hunks)
  • .github/workflows/deploy-prod.yml (2 hunks)
Additional comments: 5
.github/workflows/deploy-preview.yml (3)
  • 11-15: The update to Node.js version 'lts/gallium' and the addition of 'yarn' cache are good practices for ensuring the build environment is up-to-date and dependencies are cached for faster builds. Ensure that 'lts/gallium' is compatible with the project's Node.js requirements.

  • 26-33: Pinning the Firebase tools version to '12.9.1' is a good practice for maintaining consistent build environments. Verify that this version is compatible with the project's requirements and does not introduce any breaking changes.

  • 28-29: Enclosing the repoToken and firebaseServiceAccount in single quotes is a minor syntax change that should not affect functionality, as long as the secrets are correctly set in the GitHub repository settings.

.github/workflows/deploy-prod.yml (2)
  • 14-18: The update to Node.js version 'lts/gallium' and cache to 'yarn' is clear and should not affect any exported or public entities.

  • 29-36: The syntax changes to use single quotes for repoToken and firebaseServiceAccount, and the pinning of firebaseToolsVersion to '12.9.1' are appropriate and follow best practices for YAML files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants