Skip to content

Commit

Permalink
Merge pull request #3302 from nervosnetwork/rc/v0.121.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY authored Jan 16, 2025
2 parents 5d2ecf9 + 0b99eaf commit 5e5c406
Show file tree
Hide file tree
Showing 34 changed files with 598 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .ckb-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.120.0
v0.121.0-rc1
49 changes: 49 additions & 0 deletions .github/workflows/spam-comment-detection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Spam detection

on:
issue_comment:
types: [created, edited]

permissions:
issues: write

jobs:
detect-spam:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@main

- name: Check for Spam
uses: actions/github-script@v7
with:
script: |
const comment = process.env.COMMENT_BODY.toLowerCase()
const spam_words = process.env.SPAM_WORDS.split(',').map(w => w.toLowerCase())
const comment_id = process.env.COMMENT_ID
const issue_number = process.env.ISSUE_NUMBER
const owner = process.env.REPO_OWNER
const repo = process.env.REPO_NAME
const EXTERNAL_LINK_REGEXT = /https?:\/\/(?!((\w+\.)?github\.com|github\.com|(\w+\.)?magickbase\.com|(\w+\.)?nervos\.org))/gi
if (spam_words.some(w => comment.includes(w))) {
console.info(`Spam comment: ${comment}`)
github.rest.issues.deleteComment({ owner, repo, comment_id })
} else if (EXTERNAL_LINK_REGEXT.test(comment)) {
console.info(`External link detected, append an annotation`)
github.rest.issues.createComment({
owner,
repo,
issue_number,
body: `An external link is mentioned in the comment above. Please verify the link's safety before visiting.`
})
} else {
console.info("No spam detected")
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_ID: ${{ github.event.comment.id }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPO_OWNER: ${{github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
SPAM_WORDS: ${{ secrets.SPAM_WORDS }}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# 0.121.0 (2025-01-16)

### CKB Node & Light Client

- [[email protected]](https://github.com/nervosnetwork/ckb/releases/tag/v0.121.0-rc1) was released on Jan. 9th, 2025. This version of CKB node is now bundled and preconfigured in Neuron.
- [CKB Light [email protected]](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.4.1) was released on Nov. 13th, 2024. This version of CKB Light Client is now bundled and preconfigured in Neuron

### Assumed valid target

Block before `0x1381f9e4f70ce521256c4095fa536d11165488171a8a2cbac687f8cf53907afa`(at height `15,119,157`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/3300)

---

## New features

- #3290: Support inspecting and exporting private key for specific addresses.(@devchenyan)
- #3293: Refine interaction of Sign and Verify Message.(@devchenyan)


**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.120.0...v0.121.0


# 0.120.0 (2024-12-13)

### CKB Node & Light Client
Expand Down
35 changes: 34 additions & 1 deletion compatible.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"fullVersions": [
"0.121",
"0.120",
"0.119",
"0.118",
Expand Down Expand Up @@ -27,6 +28,7 @@
"compatible": {
"0.111": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
Expand All @@ -48,6 +50,7 @@
},
"0.110": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
Expand Down Expand Up @@ -85,6 +88,7 @@
},
"0.112": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
Expand All @@ -106,6 +110,7 @@
},
"0.114": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
Expand All @@ -127,6 +132,7 @@
},
"0.116": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
Expand All @@ -148,6 +154,7 @@
},
"0.117": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
Expand All @@ -169,6 +176,8 @@
},
"0.119": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
"0.117",
Expand All @@ -189,6 +198,30 @@
},
"0.120": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
"0.117",
"0.116",
"0.115",
"0.114",
"0.113",
"0.112",
"0.111",
"0.110",
"0.109"
],
"light": [
"0.4",
"0.3",
"0.2"
]
},
"0.121": {
"full": [
"0.121",
"0.120",
"0.119",
"0.118",
"0.117",
Expand All @@ -208,4 +241,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "0.120.0",
"version": "0.121.0",
"npmClient": "yarn",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "neuron",
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"version": "0.120.0",
"version": "0.121.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neuron-ui",
"version": "0.120.0",
"version": "0.121.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@
}
}

.privateKey {
background: transparent;
border: none;
cursor: pointer;
&:hover {
svg {
g,
path {
stroke: var(--primary-color);
}
}
}
}

@media screen and (max-width: 1330px) {
.container {
.balance {
Expand Down
23 changes: 22 additions & 1 deletion packages/neuron-ui/src/components/AddressBook/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { useTranslation } from 'react-i18next'
import { useState as useGlobalState, useDispatch } from 'states'
import Dialog from 'widgets/Dialog'
import CopyZone from 'widgets/CopyZone'
import { Copy } from 'widgets/Icons/icon'
import ViewPrivateKey from 'components/ViewPrivateKey'
import { Copy, PrivateKey } from 'widgets/Icons/icon'
import Table, { TableProps, SortType } from 'widgets/Table'
import { shannonToCKBFormatter, useLocalDescription } from 'utils'
import { HIDE_BALANCE } from 'utils/const'
Expand Down Expand Up @@ -44,6 +45,7 @@ const AddressBook = ({ onClose }: { onClose?: () => void }) => {

const dispatch = useDispatch()
const { onChangeEditStatus, onSubmitDescription } = useLocalDescription('address', walletId, dispatch)
const [viewPrivateKeyAddress, setViewPrivateKeyAddress] = useState('')

const columns = useMemo<TableProps<State.Address>['columns']>(
() => [
Expand Down Expand Up @@ -149,6 +151,21 @@ const AddressBook = ({ onClose }: { onClose?: () => void }) => {
return 0
},
},
{
title: '',
dataIndex: 'key',
align: 'left',
width: '40px',
render(_, __, { address }) {
return (
<Tooltip tip={t('addresses.view-private-key')} placement="left">
<button type="button" className={styles.privateKey} onClick={() => setViewPrivateKeyAddress(address)}>
<PrivateKey />
</button>
</Tooltip>
)
},
},
],
[t]
)
Expand Down Expand Up @@ -179,6 +196,10 @@ const AddressBook = ({ onClose }: { onClose?: () => void }) => {
}
/>
</div>

{!!viewPrivateKeyAddress && (
<ViewPrivateKey address={viewPrivateKeyAddress} onClose={() => setViewPrivateKeyAddress('')} />
)}
</div>
</Dialog>
)
Expand Down
36 changes: 23 additions & 13 deletions packages/neuron-ui/src/components/Receive/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Button from 'widgets/Button'
import CopyZone from 'widgets/CopyZone'
import QRCode from 'widgets/QRCode'
import Tooltip from 'widgets/Tooltip'
import { AddressTransform, Download, Copy, Attention, SuccessNoBorder } from 'widgets/Icons/icon'
import ViewPrivateKey from 'components/ViewPrivateKey'
import { AddressTransform, Download, Copy, Attention, SuccessNoBorder, PrivateKey } from 'widgets/Icons/icon'
import VerifyHardwareAddress from './VerifyHardwareAddress'
import styles from './receive.module.scss'
import { useCopyAndDownloadQrCode, useSwitchAddress } from './hooks'
Expand All @@ -29,6 +30,7 @@ export const AddressQrCodeWithCopyZone = ({
)

const [isCopySuccess, setIsCopySuccess] = useState(false)
const [showViewPrivateKey, setShowViewPrivateKey] = useState(false)
const timer = useRef<ReturnType<typeof setTimeout>>()
const { ref, onCopyQrCode, onDownloadQrCode, showCopySuccess } = useCopyAndDownloadQrCode()

Expand Down Expand Up @@ -70,19 +72,27 @@ export const AddressQrCodeWithCopyZone = ({
<CopyZone content={showAddress} className={styles.showAddress}>
{showAddress}
</CopyZone>
<button
type="button"
className={styles.addressToggle}
onClick={onClick}
title={transformLabel}
onFocus={stopPropagation}
onMouseOver={stopPropagation}
onMouseUp={stopPropagation}
>
<AddressTransform />
{transformLabel}
</button>
<div className={styles.actionWrap}>
<button
type="button"
className={styles.addressToggle}
onClick={onClick}
title={transformLabel}
onFocus={stopPropagation}
onMouseOver={stopPropagation}
onMouseUp={stopPropagation}
>
<AddressTransform />
{transformLabel}
</button>
<button type="button" className={styles.privateKey} onClick={() => setShowViewPrivateKey(true)}>
<PrivateKey />
{t('addresses.view-private-key')}
</button>
</div>
</div>

{showViewPrivateKey && <ViewPrivateKey address={showAddress} onClose={() => setShowViewPrivateKey(false)} />}
</div>
)
}
Expand Down
48 changes: 32 additions & 16 deletions packages/neuron-ui/src/components/Receive/receive.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,42 @@
color: var(--main-text-color);
}

.addressToggle {
width: 100%;
.actionWrap {
margin-top: 8px;
appearance: none;
border: none;
background: none;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
font-family: PingFang SC;
font-style: normal;
font-weight: 500;
color: var(--primary-color);
line-height: normal;
cursor: pointer;
gap: 32px;

svg {
pointer-events: none;
margin-right: 5px;
button {
appearance: none;
border: none;
background: none;
font-size: 12px;
font-style: normal;
font-weight: 500;
color: var(--primary-color);
line-height: normal;
cursor: pointer;
display: flex;
align-items: center;
}

.addressToggle {
svg {
pointer-events: none;
margin-right: 5px;
}
}

.privateKey {
svg {
width: 16px;
margin-right: 3px;
g,
path {
stroke: var(--primary-color);
}
}
}
}

Expand Down
Loading

3 comments on commit 5e5c406

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 12805337730

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 12809615212

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'%0A'### Downloads'%0A''%0A'OS | Arch | Package | SHA256 Checksum'%0A'-- | -- | -- | --'%0A'Windows | x64 | exe | 610c1e649bd141857d93798abcc78cac5564ff74b5116cca9544e8a4a4ea9efd'%0A'macOS | x64 | zip | c31619090d1eb541df7547b0cc4dd968815dd394669cc585ddebeeff4df9a942'%0A'macOS | arm64 | zip | 7d028adc616fab51837990e1a2510bc2d5413ac8bd015800fcfb94ddec03708c'%0A'macOS | x64 | DMG | 190641e4e304c732c1c507507b45ff85df4a07ac6b6cb6a65b573a1040806a04'%0A'macOS | arm64 | DMG | 0d4f8f427770cfc43f4d104e69fd4749b37ff7b32dce9fab716f991edb8994d2'%0A'Linux | x64 | AppImage | 7b83566892bb6fe3ca106aa9bd4f26de0d0f8f12aab67c67538c5ba8c1f93568

Please sign in to comment.