Skip to content

Commit

Permalink
Merge pull request #1379 from nervosnetwork/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY authored Nov 10, 2023
2 parents e74c370 + 01495d0 commit 0e49fef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
8 changes: 8 additions & 0 deletions src/constants/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,4 +489,12 @@ export const TestnetContractHashTags: ContractHashTag[] = [
tag: 'omni_lock v2',
category: 'lock',
},
{
codeHashes: ['0xd23761b364210735c19c60561d213fb3beae2fd6172743719eff6920e020baac'],
txHashes: ['0x4dcf3f3b09efac8995d6cbee87c5345e812d310094651e0c3d9a730f32dc9263-0'],
depType: 'dep_group',
hashType: 'type',
tag: 'JoyID',
category: 'lock',
},
]
35 changes: 16 additions & 19 deletions src/pages/ScriptList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ const ScriptList: FC = () => {
<div className={styles.container}>
{[...scripts].map(([label, meta]) => {
const script = scriptDataList.find(s => s.tag === label)
if (!script) return null
return (
<details key={label} id={label} open={label === defaultOpenLabel}>
<summary data-deprecated={!!meta.deprecated} title={meta.deprecated ? 'Deprecated' : undefined}>
Expand All @@ -226,22 +227,19 @@ const ScriptList: FC = () => {
</a>
) : null,
)}
{script ? (
<a
href={`/script/${script.codeHashes[0]}/${script.hashType}`}
target="_blank"
rel="noopener noreferrer"
>
{t('script_list.link.detail')}
</a>
) : null}
<a
href={`/script/${script.codeHashes[0]}/${script.hashType}`}
target="_blank"
rel="noopener noreferrer"
>
{t('script_list.link.detail')}
</a>
</div>
{script ? (
<>
<h3>{`${t(`script_list.on_chain_data`)}:`}</h3>
{script.codeHashes.map((codeHash: string, idx: number) => (
<pre key={codeHash}>
{`{
<>
<h3>{`${t(`script_list.on_chain_data`)}:`}</h3>
{script.codeHashes.map((codeHash: string, idx: number) => (
<pre key={codeHash}>
{`{
"code_hash": "${codeHash}",
"hash_type": "${script.hashType}",
"out_point": {
Expand All @@ -250,10 +248,9 @@ const ScriptList: FC = () => {
},
"dep_type": "${script.depType}"
}`}
</pre>
))}
</>
) : null}
</pre>
))}
</>
</div>
</details>
)
Expand Down

0 comments on commit 0e49fef

Please sign in to comment.