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
a7a0a395
Commit
a7a0a395
authored
Jan 29, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review fixes
parent
b752acc9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
45 deletions
+50
-45
[hash].tsx
pages/op/[hash].tsx
+1
-1
userOps.ts
stubs/userOps.ts
+22
-19
userOps.ts
types/api/userOps.ts
+0
-1
SearchResults.tsx
ui/pages/SearchResults.tsx
+6
-6
UserOps.pw.tsx
ui/pages/UserOps.pw.tsx
+4
-1
UserOps.pw.tsx_mobile_base-view-mobile-1.png
...creenshots__/UserOps.pw.tsx_mobile_base-view-mobile-1.png
+0
-0
SearchResultListItem.tsx
ui/searchResults/SearchResultListItem.tsx
+7
-7
SearchResultTableItem.tsx
ui/searchResults/SearchResultTableItem.tsx
+7
-7
UserOpRaw.tsx
ui/userOp/UserOpRaw.tsx
+2
-2
UserOpsContent.tsx
ui/userOps/UserOpsContent.tsx
+1
-1
No files found.
pages/op/[hash].tsx
View file @
a7a0a395
...
...
@@ -9,7 +9,7 @@ const UserOp = dynamic(() => import('ui/pages/UserOp'), { ssr: false });
const
Page
:
NextPage
<
Props
>
=
(
props
:
Props
)
=>
{
return
(
<
PageNextJs
pathname=
"/op/[h
eight_or_h
ash]"
query=
{
props
}
>
<
PageNextJs
pathname=
"/op/[hash]"
query=
{
props
}
>
<
UserOp
/>
</
PageNextJs
>
);
...
...
stubs/userOps.ts
View file @
a7a0a395
import
type
{
UserOpsItem
,
UserOp
,
UserOpsAccount
}
from
'
types/api/userOps
'
;
import
{
ADDRESS_HASH
}
from
'
./addressParams
'
;
import
{
BLOCK_HASH
}
from
'
./block
'
;
import
{
TX_HASH
}
from
'
./tx
'
;
const
USER_OP_HASH
=
'
0xb94fab8f31f83001a23e20b2ce3cdcfb284c57a64b9a073e0e09c018bc701978
'
;
export
const
USER_OPS_ITEM
:
UserOpsItem
=
{
hash
:
'
0xb94fab8f31f83001a23e20b2ce3cdcfb284c57a64b9a073e0e09c018bc701978
'
,
hash
:
USER_OP_HASH
,
block_number
:
'
10356381
'
,
transaction_hash
:
'
0xffcef406eb73986e25666ecfbe03b9dd19d19f28af7477923a5d2979f7b06a43
'
,
address
:
'
0x749abd4A31CC4B005526A5F288BEB27f3e239067
'
,
transaction_hash
:
TX_HASH
,
address
:
ADDRESS_HASH
,
timestamp
:
'
2023-12-18T10:48:49.000000Z
'
,
status
:
true
,
fee
:
'
48285720012071430
'
,
};
export
const
USER_OP
:
UserOp
=
{
hash
:
'
0x20d6ed2bf0a04b011184c801e0b79fbd9411d32be14a6fab3d6150f2691970df
'
,
sender
:
'
0xAb28462026f7E7318808a6aF1accAbD13031Af9c
'
,
nonce
:
'
0x000000000000000000000000000000000000000000000000000000000000000b
'
,
// eslint-disable-next-line max-len
call_data
:
'
0x51945447000000000000000000000000fd04fb0538479ad70dfae539c875b2c1802050120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024d55f960d0adbe9c9b444dc1fbe2b475312067d9dea42db93646ccc87057657aba1d49cd800000000000000000000000000000000000000000000000000000000
'
,
hash
:
USER_OP_HASH
,
sender
:
ADDRESS_HASH
,
nonce
:
'
0x00b
'
,
call_data
:
'
0x123
'
,
call_gas_limit
:
'
71316
'
,
verification_gas_limit
:
'
91551
'
,
pre_verification_gas
:
'
53627
'
,
max_fee_per_gas
:
'
100000020
'
,
max_priority_fee_per_gas
:
'
100000000
'
,
// eslint-disable-next-line max-len
signature
:
'
0x00000000e1dcf07c8718b7332ec4df784a18ea1d94a22886b9640c47a14ff3642c11840a63b7bb7f1d421d3eed4f8c5ca40cc421bbde196afa430aad9773703e23c382d11c
'
,
signature
:
'
0x000
'
,
aggregator
:
null
,
aggregator_signature
:
null
,
entry_point
:
'
0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
'
,
transaction_hash
:
'
0xf2609117783dde161ee08f48e0ce4769645956eb7b86897290592cf85a268d7d
'
,
entry_point
:
ADDRESS_HASH
,
transaction_hash
:
TX_HASH
,
block_number
:
'
10358181
'
,
block_hash
:
'
0xbb29763848c5201c47c3a0d44148b662222c480c4f12ec03fe7f8129d6af9eb0
'
,
bundler
:
'
0x6892BEF4aE1b5cb33F9A175Ab822518c9025fc3C
'
,
block_hash
:
BLOCK_HASH
,
bundler
:
ADDRESS_HASH
,
factory
:
null
,
paymaster
:
'
0xE93ECa6595fe94091DC1af46aaC2A8b5D7990770
'
,
paymaster
:
ADDRESS_HASH
,
status
:
true
,
revert_reason
:
null
,
gas
:
'
399596
'
,
...
...
@@ -43,18 +47,17 @@ export const USER_OP: UserOp = {
user_logs_count
:
1
,
user_logs_start_index
:
2
,
raw
:
{
sender
:
'
0xbE0c5Ef0Da631723Fc32EC12a61173628774Efd2
'
,
sender
:
ADDRESS_HASH
,
nonce
:
'
1
'
,
init_code
:
'
0x
'
,
// eslint-disable-next-line max-len
call_data
:
'
0x34fcd5be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000004200000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb00000000000000000000000030713a9895e150d73fb7676d054814d30266f8f100000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000000000000
'
,
call_data
:
'
0x345
'
,
call_gas_limit
:
'
29491
'
,
verification_gas_limit
:
'
80734
'
,
pre_verification_gas
:
'
3276112
'
,
max_fee_per_gas
:
'
309847206
'
,
max_priority_fee_per_gas
:
'
100000000
'
,
paymaster_and_data
:
'
0x
'
,
signature
:
'
0x000
000000beec352335acb3aef09a1f4e00877540db24283a347c475bdee548df87b8bc424e6493076495fdf7ced709507e45245b54e59c967dfdf1d24815416e8a639bb1b
'
,
signature
:
'
0x000
'
,
},
};
...
...
types/api/userOps.ts
View file @
a7a0a395
...
...
@@ -48,7 +48,6 @@ export type UserOp = {
call_data
:
string
;
user_logs_start_index
:
number
;
user_logs_count
:
number
;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
raw
:
{
call_data
:
string
;
call_gas_limit
:
string
;
...
...
ui/pages/SearchResults.tsx
View file @
a7a0a395
...
...
@@ -69,7 +69,7 @@ const SearchResultsPageContent = () => {
event
.
preventDefault
();
},
[
]);
const
d
ataToDisplay
=
(
data
?.
items
||
[]).
filter
((
item
)
=>
{
const
d
isplayedItems
=
(
data
?.
items
||
[]).
filter
((
item
)
=>
{
if
(
!
config
.
features
.
userOps
.
isEnabled
&&
item
.
type
===
'
user_operation
'
)
{
return
false
;
}
...
...
@@ -81,7 +81,7 @@ const SearchResultsPageContent = () => {
return
<
DataFetchAlert
/>;
}
const
hasData
=
d
ataToDisplay
.
length
||
(
pagination
.
page
===
1
&&
marketplaceApps
.
displayedApps
.
length
);
const
hasData
=
d
isplayedItems
.
length
||
(
pagination
.
page
===
1
&&
marketplaceApps
.
displayedApps
.
length
);
if
(
!
hasData
)
{
return
null
;
...
...
@@ -97,7 +97,7 @@ const SearchResultsPageContent = () => {
searchTerm=
{
debouncedSearchTerm
}
/>
))
}
{
d
ataToDisplay
.
map
((
item
,
index
)
=>
(
{
d
isplayedItems
.
map
((
item
,
index
)
=>
(
<
SearchResultListItem
key=
{
(
isPlaceholderData
?
'
placeholder_
'
:
'
actual_
'
)
+
index
}
data=
{
item
}
...
...
@@ -124,7 +124,7 @@ const SearchResultsPageContent = () => {
searchTerm=
{
debouncedSearchTerm
}
/>
))
}
{
d
ataToDisplay
.
map
((
item
,
index
)
=>
(
{
d
isplayedItems
.
map
((
item
,
index
)
=>
(
<
SearchResultTableItem
key=
{
(
isPlaceholderData
?
'
placeholder_
'
:
'
actual_
'
)
+
index
}
data=
{
item
}
...
...
@@ -144,7 +144,7 @@ const SearchResultsPageContent = () => {
return
null
;
}
const
resultsCount
=
pagination
.
page
===
1
&&
!
data
?.
next_page_params
?
(
d
ataToDisplay
.
length
||
0
)
+
marketplaceApps
.
displayedApps
.
length
:
'
50+
'
;
const
resultsCount
=
pagination
.
page
===
1
&&
!
data
?.
next_page_params
?
(
d
isplayedItems
.
length
||
0
)
+
marketplaceApps
.
displayedApps
.
length
:
'
50+
'
;
const
text
=
isPlaceholderData
&&
pagination
.
page
===
1
?
(
<
Skeleton
h=
{
6
}
w=
"280px"
borderRadius=
"full"
mb=
{
pagination
.
isVisible
?
0
:
6
}
/>
...
...
@@ -155,7 +155,7 @@ const SearchResultsPageContent = () => {
<
chakra
.
span
fontWeight=
{
700
}
>
{
resultsCount
}
</
chakra
.
span
>
<
span
>
matching result
{
(((
d
ataToDisplay
.
length
||
0
)
+
marketplaceApps
.
displayedApps
.
length
)
>
1
)
||
pagination
.
page
>
1
?
'
s
'
:
''
}
for
</
span
>
<
span
>
matching result
{
(((
d
isplayedItems
.
length
||
0
)
+
marketplaceApps
.
displayedApps
.
length
)
>
1
)
||
pagination
.
page
>
1
?
'
s
'
:
''
}
for
</
span
>
“
<
chakra
.
span
fontWeight=
{
700
}
>
{
debouncedSearchTerm
}
</
chakra
.
span
>
”
</
Box
>
)
...
...
ui/pages/UserOps.pw.tsx
View file @
a7a0a395
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
{
test
as
base
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
...
...
@@ -29,7 +30,9 @@ test('base view +@mobile', async({ mount, page }) => {
const
component
=
await
mount
(
<
TestApp
>
<
UserOps
/>
<
Box
pt=
{
{
base
:
'
106px
'
,
lg
:
0
}
}
>
<
UserOps
/>
</
Box
>
</
TestApp
>,
);
...
...
ui/pages/__screenshots__/UserOps.pw.tsx_mobile_base-view-mobile-1.png
View replaced file @
b752acc9
View file @
a7a0a395
65.4 KB
|
W:
|
H:
70.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/searchResults/SearchResultListItem.tsx
View file @
a7a0a395
...
...
@@ -15,7 +15,7 @@ import * as AddressEntity from 'ui/shared/entities/address/AddressEntity';
import
*
as
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
*
as
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
*
as
UserOpEtity
from
'
ui/shared/entities/userOp/UserOpEntity
'
;
import
*
as
UserOpE
n
tity
from
'
ui/shared/entities/userOp/UserOpEntity
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
...
...
@@ -202,22 +202,22 @@ const SearchResultListItem = ({ data, searchTerm, isLoading }: Props) => {
}
case
'
user_operation
'
:
{
return
(
<
UserOpEtity
.
Container
>
<
UserOpEtity
.
Icon
/>
<
UserOpEtity
.
Link
<
UserOpE
n
tity
.
Container
>
<
UserOpE
n
tity
.
Icon
/>
<
UserOpE
n
tity
.
Link
isLoading=
{
isLoading
}
hash=
{
data
.
user_operation_hash
}
onClick=
{
handleLinkClick
}
>
<
UserOpEtity
.
Content
<
UserOpE
n
tity
.
Content
asProp=
"mark"
hash=
{
data
.
user_operation_hash
}
fontSize=
"sm"
lineHeight=
{
5
}
fontWeight=
{
700
}
/>
</
UserOpEtity
.
Link
>
</
UserOpEtity
.
Container
>
</
UserOpE
n
tity
.
Link
>
</
UserOpE
n
tity
.
Container
>
);
}
}
...
...
ui/searchResults/SearchResultTableItem.tsx
View file @
a7a0a395
...
...
@@ -15,7 +15,7 @@ import * as AddressEntity from 'ui/shared/entities/address/AddressEntity';
import
*
as
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
*
as
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
*
as
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
*
as
UserOpEtity
from
'
ui/shared/entities/userOp/UserOpEntity
'
;
import
*
as
UserOpE
n
tity
from
'
ui/shared/entities/userOp/UserOpEntity
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
...
...
@@ -289,22 +289,22 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading }: Props) => {
return
(
<>
<
Td
colSpan=
{
2
}
fontSize=
"sm"
>
<
UserOpEtity
.
Container
>
<
UserOpEtity
.
Icon
/>
<
UserOpEtity
.
Link
<
UserOpE
n
tity
.
Container
>
<
UserOpE
n
tity
.
Icon
/>
<
UserOpE
n
tity
.
Link
isLoading=
{
isLoading
}
hash=
{
data
.
user_operation_hash
}
onClick=
{
handleLinkClick
}
>
<
UserOpEtity
.
Content
<
UserOpE
n
tity
.
Content
asProp=
"mark"
hash=
{
data
.
user_operation_hash
}
fontSize=
"sm"
lineHeight=
{
5
}
fontWeight=
{
700
}
/>
</
UserOpEtity
.
Link
>
</
UserOpEtity
.
Container
>
</
UserOpE
n
tity
.
Link
>
</
UserOpE
n
tity
.
Container
>
</
Td
>
<
Td
fontSize=
"sm"
verticalAlign=
"middle"
isNumeric
>
<
Text
variant=
"secondary"
>
{
dayjs
(
data
.
timestamp
).
format
(
'
llll
'
)
}
</
Text
>
...
...
ui/userOp/UserOpRaw.tsx
View file @
a7a0a395
...
...
@@ -5,12 +5,12 @@ import type { UserOp } from 'types/api/userOps';
import
RawDataSnippet
from
'
ui/shared/RawDataSnippet
'
;
// order is taken from the ERC-4337 standard
// eslint-disable-next-line max-len
const
KEYS_ORDER
:
Array
<
keyof
UserOp
[
'
raw
'
]
>
=
[
'
sender
'
,
'
nonce
'
,
'
init_code
'
,
'
call_data
'
,
'
call_gas_limit
'
,
'
verification_gas_limit
'
,
'
pre_verification_gas
'
,
'
max_fee_per_gas
'
,
'
max_priority_fee_per_gas
'
,
'
paymaster_and_data
'
,
'
signature
'
];
interface
Props
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
rawData
?:
Record
<
string
,
any
>
;
rawData
?:
UserOp
[
'
raw
'
];
isLoading
?:
boolean
;
}
...
...
ui/userOps/UserOpsContent.tsx
View file @
a7a0a395
...
...
@@ -47,7 +47,7 @@ const UserOpsContent = ({ query, showTx = true, showSender = true }: Props) => {
)
:
null
;
const
actionBar
=
query
.
pagination
.
isVisible
?
(
<
ActionBar
mt=
{
-
6
}
alignItems=
"center"
>
<
ActionBar
mt=
{
-
6
}
>
<
Pagination
ml=
"auto"
{
...
query
.
pagination
}
/>
</
ActionBar
>
)
:
null
;
...
...
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