Skip to content

Commit

Permalink
Merge branch 'dev' into mergeMain
Browse files Browse the repository at this point in the history
  • Loading branch information
iosh authored Dec 25, 2024
2 parents 6d5063a + ff7316c commit 12ba9f9
Show file tree
Hide file tree
Showing 262 changed files with 1,789 additions and 536 deletions.
84 changes: 47 additions & 37 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
queue_rules:
- name: default queue
conditions:
- name: Automatic queue to dev on approval
queue_conditions:
- '#approved-reviews-by>=1'
- label!=work-in-progress
- label!=wip
- label!=no-auto-squash-merge
- base=dev
- head!=next
- -conflict
- -draft
- -locked
- status-success~=^version-check\s\(.*\)$
- status-success~=^lint\s\(.*\)$
- status-success~=^build\s\(.*\)$
- status-success~=^build-doc\s\(.*\)$
- status-success~=^unit-test\s\(.*\)$
- status-success~=^integration-test\s\(.*\)$
- '#review-threads-unresolved=0'
merge_conditions:
- label!=work-in-progress
- label!=wip
- status-success~=^build\s\(.*\)$
merge_method: squash
- name: Automatic queue to dev on approval (__release-pkg)
queue_conditions:
- '#approved-reviews-by>=1'
- label!=work-in-progress
- label!=wip
- label!=no-auto-squash-merge
- base=dev
- head=__release-pkg
- -conflict
- -draft
- -locked
- status-success~=^build\s\(.*\)$
- '#review-threads-unresolved=0'
merge_conditions:
- label!=work-in-progress
- label!=wip
- status-success~=^build\s\(.*\)$
merge_method: squash

pull_request_rules:
- name: automatic approval for release package PR
Expand All @@ -26,43 +62,17 @@ pull_request_rules:
- head!=main
actions:
update:
- name: Automatic queue to dev on approval [low]
conditions:
- "#approved-reviews-by>=1"
- label!=work-in-progress
- label!=wip
- label!=no-auto-squash-merge
- base=dev
- head!=next
- -conflict
- -draft
- -locked
- status-success~=^version-check\s\(.*\)$
- status-success~=^lint\s\(.*\)$
- status-success~=^build\s\(.*\)$
- status-success~=^build-doc\s\(.*\)$
- status-success~=^unit-test\s\(.*\)$
- status-success~=^integration-test\s\(.*\)$
- "#review-threads-unresolved=0"
actions:
queue:
name: default queue
method: squash

- name: Automatic queue to dev on approval (__release-pkg) [low]
- name: Automatic queue to dev on approval (__release-pkg)
conditions:
- "#approved-reviews-by>=1"
- label!=work-in-progress
- label!=wip
- label!=no-auto-squash-merge
- base=dev
- author~=^ConfluxBot$
- head=__release-pkg
- -conflict
- -draft
- -locked
- status-success~=^build\s\(.*\)$
- "#review-threads-unresolved=0"
actions:
queue:
name: default queue
method: squash
name: Automatic queue to dev on approval (__release-pkg)

- name: Automatic queue to dev on approval [low]
conditions: []
actions:
queue:
name: Automatic queue to dev on approval
1 change: 1 addition & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:
SNOWPACK_PUBLIC_SENTRY_DSN: ${{ secrets.SNOWPACK_PUBLIC_SENTRY_DSN }}
SNOWPACK_PUBLIC_FLUENT_ENV: 'debug-release'
SNOWPACK_PUBLIC_FLUENT_VERSION: ${{ fromJSON(steps.get-release-version-and-tag.outputs.result).version }}
VIEW_PACKAGE_VERSION: ${{ fromJSON(steps.get-release-version-and-tag.outputs.result).version }}
run: yarn build

- name: zip files
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prod-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
SNOWPACK_PUBLIC_SENTRY_DSN: ${{ secrets.SNOWPACK_PUBLIC_SENTRY_DSN }}
SNOWPACK_PUBLIC_FLUENT_ENV: 'production'
SNOWPACK_PUBLIC_FLUENT_VERSION: ${{ steps.get-package-version.outputs.PACKAGE_VERSION }}
VIEW_PACKAGE_VERSION: ${{ fromJSON(steps.get-release-version-and-tag.outputs.result).prod_version }}
run: yarn build

- name: zip files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- run: rm -rf .yarn/versions || true
- env:
YARN_NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: ./scripts/any-packages-version-changed.sh && yarn workspaces foreach --topological --no-private --verbose --parallel --interlaced npm publish --access public --tolerate-republish || true
run: ./scripts/any-packages-version-changed.sh && yarn workspaces foreach -A --topological --no-private --verbose --parallel --interlaced npm publish --access public --tolerate-republish || true
- run: git add .
- run: |
git -c user.name='ConfluxBot' \
Expand Down
7 changes: 6 additions & 1 deletion examples/basic-dapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
<footer>Address: <span id="address">N/A</span></footer>
</article>
<article>
<header>Send native token</header>
<label for="tx-type">transaction type:</label>
<select id="tx-type">
<option value="0x0">legacy</option>
<option value="0x2">eip1559</option>
<option value="0x1">eip2930</option>
<select>
<button id="send_native_token" disabled="true">
send native token to myself
</button>
Expand Down
4 changes: 4 additions & 0 deletions examples/basic-dapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,14 @@ async function walletInitialized() {
// send 1 native token to the connected address
sendNativeTokenButton.onclick = async () => {
const [connectedAddress] = await provider.request({method: 'cfx_accounts'})

const txType = document.querySelector('#tx-type').value

const tx = {
from: connectedAddress,
value: '0xde0b6b3a7640000',
to: connectedAddress,
type: txType,
}

provider
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "helios",
"private": true,
"version": "2.7.8",
"version": "2.8.0",
"workspaces": [
"websites/*",
"packages/doc-ui/*",
Expand Down
5 changes: 4 additions & 1 deletion packages/account/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {getAddress as toChecksumAddress} from '@ethersproject/address'
import {computeAddress} from '@ethersproject/transactions'
import {Wallet} from '@ethersproject/wallet'
import {randomInt, addHexPrefix} from '@fluent-wallet/utils'
import {randomInt, addHexPrefix, isHexString} from '@fluent-wallet/utils'
import {
NULL_HEX_ADDRESS,
INTERNAL_CONTRACTS_HEX_ADDRESS,
Expand Down Expand Up @@ -121,6 +121,9 @@ export const randomPrivateKey = () => {
export const validatePrivateKey = privateKey => {
let valid = false
try {
// If the string is not a 64-character hex string, then it is an invalid private key.
if (!isHexString(addHexPrefix(privateKey), 32)) return false

const rst = fromPrivate(privateKey)
valid = Boolean(rst.address)
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluent-wallet/account",
"version": "1.0.1",
"version": "1.0.3",
"type": "module",
"main": "index.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/addr-by-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@fluent-wallet/addr-by-network",
"type": "module",
"main": "index.js",
"version": "0.0.3",
"version": "0.0.4",
"dependencies": {
"@fluent-wallet/account": "workspace:packages/account",
"@fluent-wallet/base32-address": "workspace:packages/base32-address",
Expand Down
6 changes: 5 additions & 1 deletion packages/background/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helios-background",
"version": "0.0.15",
"version": "0.0.30",
"type": "module",
"main": "src/index.js",
"private": true,
Expand All @@ -13,7 +13,9 @@
"@fluent-wallet/cfx_check-balance-against-transaction": "workspace:packages/rpcs/cfx_checkBalanceAgainstTransaction",
"@fluent-wallet/cfx_client-version": "workspace:packages/rpcs/cfx_clientVersion",
"@fluent-wallet/cfx_epoch-number": "workspace:packages/rpcs/cfx_epochNumber",
"@fluent-wallet/cfx_estimate-1559-fee": "workspace:packages/rpcs/cfx_estimate1559Fee",
"@fluent-wallet/cfx_estimate-gas-and-collateral": "workspace:packages/rpcs/cfx_estimateGasAndCollateral",
"@fluent-wallet/cfx_fee-history": "workspace:packages/rpcs/cfx_feeHistory",
"@fluent-wallet/cfx_gas-price": "workspace:packages/rpcs/cfx_gasPrice",
"@fluent-wallet/cfx_get-account": "workspace:packages/rpcs/cfx_getAccount",
"@fluent-wallet/cfx_get-account-pending-info": "workspace:*",
Expand All @@ -30,6 +32,7 @@
"@fluent-wallet/cfx_get-code": "workspace:packages/rpcs/cfx_getCode",
"@fluent-wallet/cfx_get-collateral-for-storage": "workspace:packages/rpcs/cfx_getCollateralForStorage",
"@fluent-wallet/cfx_get-confirmation-risk-by-hash": "workspace:packages/rpcs/cfx_getConfirmationRiskByHash",
"@fluent-wallet/cfx_get-fee-burnt": "workspace:packages/rpcs/cfx_getFeeBurnt",
"@fluent-wallet/cfx_get-interest-rate": "workspace:*",
"@fluent-wallet/cfx_get-logs": "workspace:packages/rpcs/cfx_getLogs",
"@fluent-wallet/cfx_get-max-gas-limit": "workspace:*",
Expand All @@ -46,6 +49,7 @@
"@fluent-wallet/cfx_get-transaction-by-hash": "workspace:packages/rpcs/cfx_getTransactionByHash",
"@fluent-wallet/cfx_get-transaction-receipt": "workspace:packages/rpcs/cfx_getTransactionReceipt",
"@fluent-wallet/cfx_get-vote-list": "workspace:packages/rpcs/cfx_getVoteList",
"@fluent-wallet/cfx_max-priority-fee-per-gas": "workspace:packages/rpcs/cfx_maxPriorityFeePerGas",
"@fluent-wallet/cfx_net-version": "workspace:packages/rpcs/cfx_netVersion",
"@fluent-wallet/cfx_opened-method-groups": "workspace:*",
"@fluent-wallet/cfx_request-accounts": "workspace:packages/rpcs/cfx_requestAccounts",
Expand Down
Loading

0 comments on commit 12ba9f9

Please sign in to comment.