Skip to content

Commit

Permalink
Merge branch 'develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez authored Nov 28, 2024
2 parents 8776387 + 64bca64 commit c42a88b
Show file tree
Hide file tree
Showing 377 changed files with 8,210 additions and 2,930 deletions.
1 change: 1 addition & 0 deletions .github/actions/diffs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ runs:
- "Cargo.toml"
- "Cargo.lock"
- ".config/nextest.toml"
- "rust-toolchain.toml"
isDoc:
- "docs/content/**"
- "docs/site/**"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/_cargo_deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ jobs:
name: cargo deny (bans, licenses, sources)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check bans licenses sources

advisories:
name: cargo deny (advisories)
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- run: cargo deny --manifest-path ${{ inputs.manifest-path || './Cargo.toml' }} check advisories
5 changes: 0 additions & 5 deletions .github/workflows/_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ on:
inputs:
isRust:
type: boolean
secrets:
SSH_PRIVATE_KEY_IOTA_CI:
required: true
SSH_GITHUB_KNOWN_HOSTS:
required: true

env:
CARGO_TERM_COLOR: always
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/_rust_lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ jobs:
# See '.cargo/config' for list of enabled/disabled clippy lints
- name: Check Clippy Lints
run: cargo ci-clippy

- name: Check Clippy Lints with msim
run: |
git clean -fd
./scripts/simtest/clippy.sh
43 changes: 43 additions & 0 deletions .github/workflows/apps_wallet_prod_build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build Wallet App (Prod)

on:
workflow_dispatch:
push:
tags:
- "wallet-v[0-9]+.[0-9]+.[0-9]+"
Expand Down Expand Up @@ -39,6 +40,48 @@ jobs:
echo "artifact_name=${artifact_name}" >> $GITHUB_ENV
- name: Build Wallet
run: pnpm wallet build
- name: Get Previous Tag
id: prev_tag
run: |
tags=$(git tag --list 'wallet-v*.*.*' --sort=-creatordate)
current_tag=$(echo "$tags" | sed -n 1p)
prev_tag=$(echo "$tags" | sed -n 2p)
if [ -z "$prev_tag" ]; then
echo "No previous tag found. Skipping changelog generation."
echo "PREV_TAG=none" >> $GITHUB_ENV
else
echo "PREV_TAG=$prev_tag" >> $GITHUB_ENV
fi
echo "CURRENT_TAG=$current_tag" >> $GITHUB_ENV
- name: Generate Changelog
id: generate_changelog
run: |
if [ "${{ env.PREV_TAG }}" = "none" ]; then
echo "No previous tag found. Skipping changelog generation."
echo "changelog=No previous tag found. Changelog generation skipped." >> $GITHUB_ENV
else
git log ${{ env.PREV_TAG }}..${{ env.CURRENT_TAG }} --pretty=format:"- %s by @%an in #%h" -- ./apps/wallet > CHANGELOG.md
changelog=$(cat CHANGELOG.md)
echo "changelog=$changelog" >> $GITHUB_ENV
fi
- name: Get version from tag
id: version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/wallet-v}"

- name: Create GitHub Release
uses: elgohr/Github-Release-Action@c5ea99036abb741a89f8bf1f2cd7fba845e3313a # pin@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.CURRENT_TAG }}
release_name: IOTA Wallet v${{ steps.version.outputs.version }}
body: |
## Changelog
{{ env.changelog }}
draft: true
prerelease: false
- name: Upload artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4
with:
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/hierarchy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,33 +75,6 @@ jobs:
if: (!cancelled() && needs.diff.outputs.isDoc == 'true')
uses: ./.github/workflows/_docs_lint.yml

release-notes-description-check:
name: release-notes-check
concurrency:
group: release-notes-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
needs: diff
if: (!cancelled() && needs.diff.outputs.isReleaseNotesEligible == 'true')
runs-on: [self-hosted]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- name: Check Pull Request Description
shell: bash
run: |
export PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
export DESCRIPTION=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/iotaledger/iota/pulls/${PR_NUMBER}" \
| jq --raw-output .body)
if [[ "${DESCRIPTION}" == *"[x]"* ]]; then
if [[ "${DESCRIPTION}" =~ Release[[:space:]]notes[[:space:]]+.* ]]; then
exit 0
else
echo "At least one '[x]' was checked under 'Type of Change (Check all that apply)', you need to add a blob under the 'Release Notes' section."
exit 1
fi
fi
turborepo:
needs:
- dprint-format
Expand Down
5 changes: 4 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ strat = "strat"
mistic = "mistic"
# Identity
AAS = "AAS"
# actual typos purposedly used in tests
# actual typos purposely used in tests
assing = "assing"
tring = "tring"
Thi = "Thi"

[files]
extend-exclude = ["pnpm-lock.yaml", "external-crates/*"]
34 changes: 27 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ crossterm = "0.25.0"
csv = "1.2.1"
dashmap = "5.5.3"
datatest-stable = { git = "https://github.com/nextest-rs/datatest-stable.git", rev = "72db7f6d1bbe36a5407e96b9488a581f763e106f" }
derivative = "2.2.0"
derive_more = "1.0"
diesel = { version = "2.1.0", features = ["chrono", "r2d2", "serde_json", "64-column-tables", "i-implement-a-third-party-backend-and-opt-into-breaking-changes"] }
dirs = "5.0"
ed25519-consensus = { version = "2.0.1", features = ["serde"] }
Expand Down Expand Up @@ -461,5 +461,3 @@ transaction-fuzzer = { path = "crates/transaction-fuzzer" }
typed-store = { path = "crates/typed-store" }
typed-store-derive = { path = "crates/typed-store-derive" }
typed-store-error = { path = "crates/typed-store-error" }

[patch.crates-io]
4 changes: 4 additions & 0 deletions apps/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@
"@amplitude/analytics-types": "^0.20.0",
"@growthbook/growthbook-react": "^1.0.0",
"@hookform/resolvers": "^3.9.0",
"@iota/apps-ui-kit": "workspace:*",
"@iota/dapp-kit": "workspace:*",
"@iota/iota-sdk": "workspace:*",
"@iota/kiosk": "workspace:*",
"@iota/ui-icons": "workspace:*",
"@sentry/react": "^7.59.2",
"@tanstack/react-query": "^5.50.1",
"bignumber.js": "^9.1.1",
"clsx": "^2.1.1",
"formik": "^2.4.2",
"qrcode.react": "^4.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
67 changes: 67 additions & 0 deletions apps/core/src/components/Inputs/AddressInput.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright (c) Mysten Labs, Inc.
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { Input, InputType } from '@iota/apps-ui-kit';
import { Close } from '@iota/ui-icons';
import { useIotaAddressValidation } from '../../hooks';
import React, { useCallback } from 'react';
import { useField, useFormikContext } from 'formik';

export interface AddressInputProps {
name: string;
disabled?: boolean;
placeholder?: string;
label?: string;
}

export function AddressInput({
name,
disabled,
placeholder = '0x...',
label = 'Enter Recipient Address',
}: AddressInputProps) {
const { validateField } = useFormikContext();
const [field, meta, helpers] = useField<string>(name);
const iotaAddressValidation = useIotaAddressValidation();

const formattedValue = iotaAddressValidation.cast(field.value);

const handleOnChange = useCallback(
async (e: React.ChangeEvent<HTMLInputElement>) => {
const address = e.currentTarget.value;
await helpers.setValue(iotaAddressValidation.cast(address));
validateField(name);
},
[name, iotaAddressValidation],
);

const clearAddress = () => {
helpers.setValue('');
};

return (
<Input
type={InputType.Text}
disabled={disabled}
placeholder={placeholder}
value={formattedValue}
name={field.name}
onBlur={field.onBlur}
label={label}
onChange={handleOnChange}
errorMessage={meta.error}
trailingElement={
formattedValue ? (
<button
onClick={clearAddress}
type="button"
className="flex items-center justify-center"
>
<Close />
</button>
) : undefined
}
/>
);
}
Loading

0 comments on commit c42a88b

Please sign in to comment.