Skip to content

Chore/worker convert #46

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 8 commits into from
Apr 30, 2025
Merged

Chore/worker convert #46

merged 8 commits into from
Apr 30, 2025

Conversation

2xburnt
Copy link
Contributor

@2xburnt 2xburnt commented Apr 30, 2025

This pull request introduces significant changes to streamline the deployment process, remove deprecated configurations, and improve type safety in the codebase. The most notable updates include the removal of configurations for the xion-testnet-1 environment, the migration of deployment settings to a new wrangler.jsonc file, and updates to type annotations for improved type safety.

Deployment and Configuration Updates:

  • Removed .env and wrangler.toml files for mainnet, testnet, and testnet2 deployments, consolidating configuration management. (.deploy/mainnet/.env, .deploy/mainnet/wrangler.toml, .deploy/testnet/.env, .deploy/testnet/wrangler.toml, .deploy/testnet2/.env, .deploy/testnet2/wrangler.toml) [1] [2] [3] [4] [5] [6]
  • Added a new wrangler.jsonc file to centralize deployment settings, including environment-specific variables and routes for mainnet and testnet.

Codebase Simplification:

  • Removed unused scripts and dependencies related to the old deployment pipeline from package.json. Updated deployment scripts to use wrangler directly. (package.json) [1] [2] [3]
  • Simplified next.config.mjs by removing proxy-related rewrites and unused setupDevPlatform initialization. (next.config.mjs) [1] [2]

Type Safety Improvements:

  • Added stricter type annotations for API responses in functions such as getInflation, getDistributionParams, and estimateGasViaRest to reduce runtime errors. (src/features/staking/lib/core/base.ts, src/features/staking/lib/core/gas.ts) [1] [2] [3]
  • Updated the getIdentityLogo function to use a typed id parameter for better clarity. (src/features/staking/lib/utils/keybase-client.ts)

Environment Cleanup:

  • Removed all references to the deprecated xion-testnet-1 environment, including its chain ID, RPC URLs, and asset endpoints. (src/config.ts) [1] [2] [3] [4]

These changes collectively simplify the deployment process, improve maintainability, and enhance code reliability.

@2xburnt 2xburnt requested a review from Copilot April 30, 2025 22:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR streamlines the deployment process and improves type safety in the codebase by removing legacy configuration files and enhancing API response typings. Key changes include:

  • Consolidating legacy environment configurations into a unified wrangler.jsonc file.
  • Updating deployment scripts and removing obsolete files.
  • Adding explicit TypeScript type annotations in API response handling to improve clarity and safety.

Reviewed Changes

Copilot reviewed 13 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/features/staking/lib/utils/keybase-client.ts Added explicit type annotation for the API response (using any).
src/features/staking/lib/core/gas.ts Introduced explicit typing for the gas API response.
src/features/staking/lib/core/base.ts Added type annotations for API responses in getInflation and getDistributionParams.
src/config.ts Removed unused testnet configuration.
server/index.ts Added a default 404 response handler.
postcss.config.js Reordered plugin configuration for readability.
next.config.mjs Simplified configuration by removing legacy proxy setup and development-only logic.
.deploy/testnet2/wrangler.toml Removed legacy deployment config file.
.deploy/testnet/wrangler.toml Removed legacy deployment config file.
.deploy/mainnet/wrangler.toml Removed legacy deployment config file.
Files not reviewed (5)
  • .deploy/mainnet/.env: Language not supported
  • .deploy/testnet/.env: Language not supported
  • .deploy/testnet2/.env: Language not supported
  • package.json: Language not supported
  • wrangler.jsonc: Language not supported
Comments suppressed due to low confidence (1)

src/features/staking/lib/core/base.ts:144

  • Avoid double-casting the JSON response. Instead, create a dedicated interface for the distribution parameters response to improve clarity and enforce type checks.
const data = await response.json() as unknown as { params: { base_proposer_reward: string; bonus_proposer_reward: string; community_tax: string; withdraw_addr_enabled: boolean; }; };

Copy link

cloudflare-workers-and-pages bot commented Apr 30, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
staking-mainnet bb3a461 Apr 30 2025, 10:28 PM

Copy link

cloudflare-workers-and-pages bot commented Apr 30, 2025

Deploying staking-mainnet with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb3a461
Status: ✅  Deploy successful!
Preview URL: https://ba6a85c7.staking-mainnet-8sr.pages.dev
Branch Preview URL: https://chore-worker-convert.staking-mainnet-8sr.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Apr 30, 2025

Deploying staking-testnet with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb3a461
Status: ✅  Deploy successful!
Preview URL: https://17351bc1.staking-testnet.pages.dev
Branch Preview URL: https://chore-worker-convert.staking-testnet.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Apr 30, 2025

Deploying staking-testnet2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb3a461
Status: ✅  Deploy successful!
Preview URL: https://c5904a49.staking-testnet2.pages.dev
Branch Preview URL: https://chore-worker-convert.staking-testnet2.pages.dev

View logs

@2xburnt 2xburnt merged commit 69bbb9b into main Apr 30, 2025
8 checks passed
@2xburnt 2xburnt deleted the chore/worker-convert branch April 30, 2025 22:33
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.

2 participants