Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
347b85fd
Unverified
Commit
347b85fd
authored
Jan 14, 2025
by
tom goriunov
Committed by
GitHub
Jan 14, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rootstock checksum is not applied on the address page (#2500)
Fixes #2494
parent
96f2e119
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
getCheckedSummedAddress.ts
lib/address/getCheckedSummedAddress.ts
+7
-1
Address.tsx
ui/pages/Address.tsx
+4
-1
No files found.
lib/address/getCheckedSummedAddress.ts
View file @
347b85fd
import
{
getAddress
}
from
'
viem
'
;
import
config
from
'
configs/app
'
;
export
default
function
getCheckedSummedAddress
(
address
:
string
):
string
{
try
{
return
getAddress
(
address
);
return
getAddress
(
address
,
// We need to pass chainId to getAddress to make it work correctly for some chains, e.g. Rootstock
config
.
chain
.
id
?
Number
(
config
.
chain
.
id
)
:
undefined
,
);
}
catch
(
error
)
{
return
address
;
}
...
...
ui/pages/Address.tsx
View file @
347b85fd
...
...
@@ -69,7 +69,6 @@ const AddressPageContent = () => {
const
tabsScrollRef
=
React
.
useRef
<
HTMLDivElement
>
(
null
);
const
hash
=
getQueryParamString
(
router
.
query
.
hash
);
const
checkSummedHash
=
React
.
useMemo
(()
=>
getCheckedSummedAddress
(
hash
),
[
hash
]);
const
checkDomainName
=
useCheckDomainNameParam
(
hash
);
const
checkAddressFormat
=
useCheckAddressFormat
(
hash
);
...
...
@@ -364,6 +363,10 @@ const AddressPageContent = () => {
return;
}, [ appProps.referrer ]);
// API always returns hash in check-summed format except for addresses that are not in the database
// In this case it returns 404 with empty payload, so we calculate check-summed hash on the client
const checkSummedHash = React.useMemo(() => addressQuery.data?.hash ?? getCheckedSummedAddress(hash), [ hash, addressQuery.data?.hash ]);
const titleSecondRow = (
<Flex alignItems="center" w="100%" columnGap={ 2 } rowGap={ 2 } flexWrap={{ base: 'wrap', lg: 'nowrap' }}>
{ addressQuery.data?.ens_domain_name && (
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment