-
Notifications
You must be signed in to change notification settings - Fork 52
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 bugs #2653
fix bugs #2653
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { getConfigFromNetwork, type NetworkType } from "../../../../../config/utils/environment"; | ||
import { Chain, getConfigFromNetwork } from "@config"; | ||
import { env } from "./../../env"; | ||
|
||
export const ETERNUM_CONFIG = async () => { | ||
const config = await getConfigFromNetwork(env.VITE_PUBLIC_CHAIN! as NetworkType); | ||
const config = await getConfigFromNetwork(env.VITE_PUBLIC_CHAIN! as Chain); | ||
return config; | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["src/*"] | ||
"@/*": ["src/*"], | ||
"@config": ["../../../config/utils/utils"] | ||
}, | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
|
@@ -24,7 +25,7 @@ | |
"jsx": "react-jsx", | ||
"types": ["vite-plugin-svgr/client", "@types/node"] | ||
}, | ||
"include": ["src", "eternumConfig.tsx"], | ||
"include": ["src", "../../../config/utils/utils"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Incorrect include pattern needs to be updated The current include pattern
Consider updating to either:
🔗 Analysis chainConsider more specific include patterns. Including the entire Let's analyze the directory contents: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# List all files in the config utils directory to assess compilation impact
fd --type f "." "../../../config/utils/utils"
# Check TypeScript file count and types
fd --type f -e ts -e tsx "." "../../../config/utils/utils" | wc -l
Length of output: 340 Script: #!/bin/bash
# Find the utils directory
fd -t d "utils$" "config"
# Once we find it, let's see what files are in there
fd -t f "." "config/utils" || true
# Check for imports from utils in the game app
rg -g "*.{ts,tsx}" "from.*utils" "client/apps/game/src" || true
Length of output: 16137 |
||
"exclude": ["node_modules", "./node_modules", "./node_modules/*", "src/node_modules", "dist", "**/*.spec.ts"], | ||
"references": [ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
import { EternumProvider } from "@bibliothecadao/eternum"; | ||
import { Account } from "starknet"; | ||
import { confirmNonLocalDeployment } from "../utils/confirmation"; | ||
import { | ||
getConfigFromNetwork, | ||
logNetwork, | ||
saveConfigJsonFromConfigTsFile, | ||
type NetworkType, | ||
} from "../utils/environment"; | ||
import { getGameManifest, type Chain } from "../utils/utils"; | ||
import { logNetwork, saveConfigJsonFromConfigTsFile, type NetworkType } from "../utils/environment"; | ||
import { getConfigFromNetwork, getGameManifest, type Chain } from "../utils/utils"; | ||
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix type inconsistency and add environment validation. Issues found:
-import { logNetwork, saveConfigJsonFromConfigTsFile, type NetworkType } from "../utils/environment";
-import { getConfigFromNetwork, getGameManifest, type Chain } from "../utils/utils";
+import { logNetwork, saveConfigJsonFromConfigTsFile } from "../utils/environment";
+import { getConfigFromNetwork, getGameManifest, type Chain } from "../utils/utils";
+// Validate environment variables
+const requiredEnvVars = {
+ VITE_PUBLIC_MASTER_ADDRESS,
+ VITE_PUBLIC_MASTER_PRIVATE_KEY,
+ VITE_PUBLIC_NODE_URL,
+ VITE_PUBLIC_CHAIN,
+ VITE_PUBLIC_VRF_PROVIDER_ADDRESS,
+} as const;
+
+Object.entries(requiredEnvVars).forEach(([key, value]) => {
+ if (!value) throw new Error(`Missing required environment variable: ${key}`);
+});
-await saveConfigJsonFromConfigTsFile(VITE_PUBLIC_CHAIN! as NetworkType);
-const configuration = await getConfigFromNetwork(VITE_PUBLIC_CHAIN! as NetworkType);
+await saveConfigJsonFromConfigTsFile(VITE_PUBLIC_CHAIN as Chain);
+const configuration = await getConfigFromNetwork(VITE_PUBLIC_CHAIN as Chain); Also applies to: 24-25 |
||
import { GameConfigDeployer } from "./config"; | ||
|
||
const { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ echo "Migrating world..." | |
sozo migrate --profile mainnet --fee eth | ||
|
||
echo "Setting up remote indexer on slot..." | ||
slot deployments create -t epic sepolia-rc-18 torii --version v1.0.7 --world 0x3dc74e8caadbde233bb750a6608e095daba2891d9784ea0fb7fbf9988948c15 --rpc https://api.cartridge.gg/x/starknet/sepolia --indexing.pending true --config ./torii-sepolia.toml | ||
slot deployments create -t epic eternum torii --version v1.0.7 --world 0x3dc74e8caadbde233bb750a6608e095daba2891d9784ea0fb7fbf9988948c15 --rpc https://api.cartridge.gg/x/starknet/sepolia --indexing.pending true --config ./torii-sepolia.toml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Update config file path in deployment command The deployment configuration is correct, but the config file path needs to be updated: - slot deployments create -t epic eternum torii --version v1.0.7 --world 0x3dc74e8caadbde233bb750a6608e095daba2891d9784ea0fb7fbf9988948c15 --rpc https://api.cartridge.gg/x/starknet/sepolia --indexing.pending true --config ./torii-sepolia.toml
+ slot deployments create -t epic eternum torii --version v1.0.7 --world 0x3dc74e8caadbde233bb750a6608e095daba2891d9784ea0fb7fbf9988948c15 --rpc https://api.cartridge.gg/x/starknet/sepolia --indexing.pending true --config contracts/game/torii-sepolia.toml Note: Using sepolia RPC and config is correct as this is deploying eternum (the game) to the sepolia network. 🔗 Analysis chainVerify deployment configuration consistency. The deployment command shows potential inconsistencies:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check if sepolia config file contains eternum-specific settings
# Check if the config file contains any sepolia-specific settings
rg -i "sepolia" ./torii-sepolia.toml
# List all configuration files to see if there's an eternum-specific one
fd -e toml
Length of output: 18136 Script: #!/bin/bash
# Check contents of sepolia config and search for eternum-specific files/settings
cat contracts/game/torii-sepolia.toml
# Search for eternum-specific config files
fd -t f -e toml eternum
fd -t f -e toml torii
# Search for eternum configuration references in the codebase
rg -i "eternum.*config" -A 5
Length of output: 75610 |
||
|
||
echo "Setting up config..." | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add validation for environment variable.
The non-null assertion operator (!) assumes
env.VITE_PUBLIC_CHAIN
will always be defined. Add a validation check to handle undefined cases gracefully.📝 Committable suggestion