Skip to content

Commit 42639c0

Browse files
authored
Merge pull request #182 from gnosischain/develop
chore: deprecate Hashi
2 parents ec3dba6 + b3efd2f commit 42639c0

8 files changed

Lines changed: 19 additions & 306 deletions

File tree

app/next.config.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,4 @@ module.exports = withBundleAnalyzer({
3232
],
3333
},
3434
transpilePackages: ['@web3-name-sdk/core'],
35-
async rewrites() {
36-
return [
37-
{
38-
source: '/api/lastseen',
39-
destination: 'https://hashi-explorer.xyz/api_bridge_ui/lastseen',
40-
},
41-
{
42-
source: '/api/num_hashi_signed/:path*',
43-
destination: 'https://hashi-explorer.xyz/api_bridge_ui/num_hashi_signed/:path*',
44-
},
45-
]
46-
},
4735
})

app/src/hooks/subgraph/useValidators.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import useSWR from 'swr'
22

33
import { BridgesValues } from '@/src/constants/config/bridges'
44
import { fetchExecutedTransactions, fetchSignedTransactions } from '@/src/utils/validators'
5-
import { useHashi } from '@/src/hooks/useHashi'
65

76
export const useFetchValidatorsSignatures = (bridge: BridgesValues, afterDate: number) => {
87
const {
@@ -13,17 +12,6 @@ export const useFetchValidatorsSignatures = (bridge: BridgesValues, afterDate: n
1312
fetchSignedTransactions(bridge, afterDate),
1413
)
1514

16-
const { getHashiSignedTransactions } = useHashi()
17-
18-
const hashiSigned = getHashiSignedTransactions(afterDate)
19-
20-
if (Array.isArray(data)) {
21-
const hashiIndex = data.findIndex((item) => item.name === 'Hashi')
22-
if (hashiIndex !== -1) {
23-
data[hashiIndex] = { ...data[hashiIndex], value: hashiSigned }
24-
}
25-
}
26-
2715
return { data, error, refetch }
2816
}
2917

app/src/hooks/useHashi.ts

Lines changed: 0 additions & 79 deletions
This file was deleted.

app/src/pagePartials/bridgeExplorer/common/ValidatorIcon.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ export const ValidatorIcon: React.FC<Props> = ({ shortName, size, title, ...rest
4747
? { image: `${basePath}giveth.svg`, size: 30, bgColor: '#fff' }
4848
: validator === 'TY'
4949
? { image: `${basePath}telepathy.svg`, size: 36, bgColor: '#fff' }
50-
: validator === 'H'
51-
? { image: `${basePath}hashi.svg`, size: 40, bgColor: '#fff' }
5250
: { image: `${basePath}empty-token.png`, size: 40, bgColor: '#3E6957' }
5351

5452
return (

app/src/pagePartials/bridgeExplorer/latestTransactions/Filters.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@ export const Filters: React.FC<Props> = ({ bridge, filters, onResetFilters, ...r
187187
const { validators } = useValidators(bridge as BridgesValues)
188188
const [resetFields, setResetFields] = useState<boolean>(false)
189189

190-
// hide Hashi from validatorsOptions - temporary until data will be fetched from hashi explorer
191-
// const validatorNames = validators.map((val) => val.name)
192-
const validatorNames = validators.filter((val) => val.name !== 'Hashi').map((val) => val.name)
190+
const validatorNames = validators.map((val) => val.name)
193191

194192
const statusNames = txStatus.map(
195193
(status) => status.charAt(0).toUpperCase() + status.slice(1).toLowerCase(),
Lines changed: 17 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled, { css } from 'styled-components'
1+
import styled from 'styled-components'
22

33
import { InnerCard } from '@/src/components/card/InnerCard'
44
import { TokenAddress } from '@/src/components/token/TokenAddress'
@@ -12,8 +12,6 @@ import {
1212
TELEPATHY_VALIDATOR_ADDRESS,
1313
TELEPATHY_VALIDATOR_ADDRESS_REPLACED,
1414
} from '@/src/constants/misc'
15-
import { IconLink } from '@/src/components/assets/IconLink'
16-
import { Tooltip } from '@/src/components/tooltip'
1715

1816
const Wrapper = styled(InnerCard)`
1917
min-height: var(--validator-item-min-height);
@@ -70,77 +68,6 @@ const Address = styled(TokenAddress)`
7068
}
7169
`
7270

73-
const TextCSS = css`
74-
color: ${({ theme: { colors } }) => colors.primary};
75-
font-size: 1.4rem;
76-
font-weight: 400;
77-
line-height: 1.5;
78-
`
79-
80-
const ExternalLink = styled.a`
81-
${TextCSS}
82-
83-
align-items: center;
84-
column-gap: var(--theme-common-space);
85-
display: flex;
86-
text-decoration: none;
87-
88-
&:active {
89-
opacity: 0.8;
90-
}
91-
`
92-
93-
const CommonCSS = css`
94-
transition: color 0.15s ease-in-out;
95-
96-
&:hover {
97-
color: ${({ theme: { colors } }) => colors.primaryDark};
98-
}
99-
100-
&:active {
101-
opacity: 0.6;
102-
}
103-
`
104-
105-
const Link = styled(IconLink)`
106-
color: ${({ theme: { colors } }) => colors.primary_50};
107-
cursor: pointer;
108-
109-
${CommonCSS}
110-
111-
svg {
112-
color: ${({ theme: { colors } }) => colors.primary_50};
113-
114-
&:hover {
115-
color: ${({ theme: { colors } }) => colors.primary};
116-
}
117-
}
118-
`
119-
120-
const ExternalLinkWrapper = styled.span`
121-
display: flex;
122-
align-items: center;
123-
column-gap: var(--theme-common-space);
124-
`
125-
126-
const HashiTooltip = styled(Tooltip)`
127-
flex-grow: 1;
128-
margin-left: var(--theme-common-space);
129-
`
130-
131-
const HashiTooltipWrapper = styled.div`
132-
display: flex;
133-
align-items: flex-start;
134-
flex-grow: 1;
135-
`
136-
137-
const Column = styled.div`
138-
display: flex;
139-
flex-direction: column;
140-
row-gap: var(--theme-common-space);
141-
align-items: flex-end;
142-
`
143-
14471
interface Props {
14572
bridgeValidator: ValidatorType
14673
}
@@ -161,20 +88,6 @@ export const Validator: React.FC<Props> = ({ bridgeValidator, ...restProps }) =>
16188
return HealthStatusTypes.success
16289
}
16390

164-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
165-
const openLink = (e: any, href: string) => {
166-
e.stopPropagation()
167-
e.preventDefault()
168-
169-
window.open(href, '_blank', 'noopener noreferrer')
170-
}
171-
172-
const isHashi = bridgeValidator.shortName === 'H'
173-
174-
// if (isHashi) {
175-
// return null
176-
// }
177-
17891
return (
17992
<Wrapper {...restProps}>
18093
<ValidatorHeader
@@ -189,89 +102,28 @@ export const Validator: React.FC<Props> = ({ bridgeValidator, ...restProps }) =>
189102
</Row>
190103
<Row>
191104
<Text>Signed (24hs)</Text>
192-
{isHashi && (
193-
<HashiTooltipWrapper>
194-
<HashiTooltip content="A message is considered signed/approved by Hashi, when a threshold amount of oracles store the same message hash w.r.t the message id." />
195-
</HashiTooltipWrapper>
196-
)}
197105
<Value>{bridgeValidator.signed}</Value>
198106
</Row>
199-
{isHashi ? (
200-
<Row>
201-
<Text>Executed (24hs)</Text>
202-
<HashiTooltipWrapper>
203-
<HashiTooltip content="Hashi only approves messages, the message is executed either by other bridge validators or by users." />
204-
</HashiTooltipWrapper>
205-
<Value>N/A</Value>
206-
</Row>
207-
) : (
208-
<Row>
209-
<Text>Executed (24hs)</Text>
210-
<Value>{bridgeValidator.executed}</Value>
211-
</Row>
212-
)}
107+
108+
<Row>
109+
<Text>Executed (24hs)</Text>
110+
<Value>{bridgeValidator.executed}</Value>
111+
</Row>
213112
</Rows>
214113
<SubTitle>Balance</SubTitle>
215114
<Row>
216-
{isHashi ? (
217-
<>
218-
<Text>N/A</Text>
219-
<HashiTooltipWrapper>
220-
<HashiTooltip content="Hashi don’t need to execute a message, hence balance field is not applicable." />
221-
</HashiTooltipWrapper>
222-
</>
223-
) : (
224-
<Balance balanceType={balanceGnosis} />
225-
)}
115+
<Balance balanceType={balanceGnosis} />
116+
</Row>
117+
118+
<Row>
119+
<Text>Send tokens</Text>
120+
<Address
121+
address={validatorAddress}
122+
characters={6}
123+
copy
124+
href={getAddressScanUrl(validatorAddress, bridgeValidator.scanUrl ?? 'gnosis')}
125+
/>
226126
</Row>
227-
{isHashi ? (
228-
<Row>
229-
<Text>Find more info</Text>
230-
<Column className="text-right">
231-
<ExternalLinkWrapper>
232-
<ExternalLink href="https://hashi-explorer.xyz/" rel="noreferrer" target="_blank">
233-
Hashi Explorer
234-
</ExternalLink>
235-
<Link
236-
className="externalLink"
237-
height={14}
238-
onClick={(e) => openLink(e, 'https://hashi-explorer.xyz/')}
239-
width={14}
240-
/>
241-
</ExternalLinkWrapper>
242-
<ExternalLinkWrapper>
243-
<ExternalLink
244-
href="https://docs.gnosischain.com/bridges/About%20Token%20Bridges/hashi-integration"
245-
rel="noreferrer"
246-
target="_blank"
247-
>
248-
Docs
249-
</ExternalLink>
250-
<Link
251-
className="externalLink"
252-
height={14}
253-
onClick={(e) =>
254-
openLink(
255-
e,
256-
'https://docs.gnosischain.com/bridges/About%20Token%20Bridges/hashi-integration',
257-
)
258-
}
259-
width={14}
260-
/>
261-
</ExternalLinkWrapper>
262-
</Column>
263-
</Row>
264-
) : (
265-
<Row>
266-
<Text>Send tokens</Text>
267-
<Address
268-
address={validatorAddress}
269-
characters={6}
270-
copy
271-
href={getAddressScanUrl(validatorAddress, bridgeValidator.scanUrl ?? 'gnosis')}
272-
/>
273-
</Row>
274-
)}
275127
</Wrapper>
276128
)
277129
}

0 commit comments

Comments
 (0)