Skip to content

Commit

Permalink
fix: resolve problem 2 from CHAIN-408 (#6)
Browse files Browse the repository at this point in the history
* resolve problem 2 from CHAIN-408

* add TODO for business

* return delegator address as well

* bump version

* upd pnpmlock as well
  • Loading branch information
AlcibiadesCleinias authored Mar 6, 2024
1 parent 488feb3 commit d45e00a
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 63 deletions.
3 changes: 3 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# If you want to add local network to access local chain and indexer, configured at
# src/constants/config.ts.
VITE_ADD_LOCAL_NETWORK=true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.env

# Logs
logs
*.log
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fluencelabs/deal-aurora": "npm:@fluencelabs/deal-ts-clients@0.7.3",
"@fluencelabs/deal-aurora": "npm:@fluencelabs/deal-ts-clients@0.8.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-aspect-ratio": "^1.0.3",
"@radix-ui/react-checkbox": "^1.0.4",
Expand Down
92 changes: 46 additions & 46 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/components/RightMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MainnetIcon, TestnetIcon } from '../assets/icons'
import { ArrowIcon } from '../assets/icons'

import { colors } from '../constants/colors'
import { ADD_LOCAL_NETWORK } from '../constants/config.ts'
import { useAppStore } from '../store'

import { Button } from './Button'
Expand All @@ -32,6 +33,14 @@ const items: SelectItem<ContractsENV>[] = [
// },
]

if (ADD_LOCAL_NETWORK) {
items.push({
label: 'Local',
value: 'local',
icon: <TestnetIcon />,
})
}

export const RightMenu: React.FC = () => {
const network = useAppStore((s) => s.network)
const setNetwork = useAppStore((s) => s.setNetwork)
Expand Down
21 changes: 8 additions & 13 deletions src/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,26 @@ import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'

import { type ChainId, RPC, SUPPORTED_CHAINS } from '.'

export const SUBGRAPH_URL: Record<ContractsENV, string> = {
testnet:
'https://api.thegraph.com/subgraphs/name/alcibiadescleinias/fluence-deal-contracts',
stage:
'https://api.thegraph.com/subgraphs/name/alcibiadescleinias/fluence-deal-contracts',
kras: 'https://api.thegraph.com/subgraphs/name/alcibiadescleinias/fluence-deal-contracts',
local:
'https://api.thegraph.com/subgraphs/name/alcibiadescleinias/fluence-deal-contracts',
}
export const ADD_LOCAL_NETWORK = ['true', 'True', 1, '1'].includes(
import.meta.env.VITE_ADD_LOCAL_NETWORK,
)

export const RPC_URL: Record<ContractsENV, string> = {
dar: 'https://ipc-dar.fluence.dev/',
stage: 'https://ipc-stage.fluence.dev/',
kras: 'https://rpc.ankr.com/polygon_mumbai',
local: 'https://rpc.ankr.com/polygon_mumbai',
kras: 'https://rpc.ankr.com/polygon_mumbai/',
local: 'http://0.0.0.0:8545/',
}

export const BLOCKSCOUT_URL: Record<ContractsENV, string> = {
dar: 'https://blockscout-dar.fluence.dev',
dar: 'https://blockscout-dar.fluence.dev/',
stage: 'https://blockscout-stage.fluence.dev/',
kras: 'https://blockscout-kras.fluence.dev',
kras: 'https://blockscout-kras.fluence.dev/',
local: 'http://localhost:4000/',
}

const { publicClient, webSocketPublicClient } = configureChains(
// TODO: what is supported chains? it consists only of polygonMumbai for now.
SUPPORTED_CHAINS,
[
jsonRpcProvider({
Expand Down
2 changes: 1 addition & 1 deletion src/pages/capacity/CapacityInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const CapacityInfo: React.FC = () => {
</Tooltip>
</Row>
<TextWithIcon>
NOT EXIST
{capacity.delegatorAddress}
<Copyable value={id} />
</TextWithIcon>
</Info>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/provider/ProviderDealsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ const DealRow: React.FC<DealRowProps> = ({ deal }) => {
</TokenBadge>
</Cell>
<Cell>
<Text size={12}>2</Text>
<Text size={12}>{deal.matchedWorkers}</Text>
</Cell>
<Cell>
<Text size={12}>2</Text>
{/* TODO: what active workers are actually means?*/}
<Text size={12}>{deal.registeredWorkers}</Text>
</Cell>
<Cell>
<DealStatus status={deal.status} />
Expand Down

0 comments on commit d45e00a

Please sign in to comment.