Skip to content

Commit

Permalink
Merge branch 'develop' into devx/simple-token-transfer-tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekjain23 authored Dec 18, 2024
2 parents 608be86 + 070a635 commit 6bd49d9
Show file tree
Hide file tree
Showing 238 changed files with 3,386 additions and 2,849 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/_rust_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
changedCrates:
type: string
required: false
runSimtest:
type: boolean
default: true

concurrency:
group: rust-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -118,6 +121,7 @@ jobs:

simtest:
name: Simtest rust
if: inputs.runSimtest
timeout-minutes: 45
runs-on: [self-hosted]
env:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ on:
schedule:
- cron: "0 0 * * *" # every day at midnight
workflow_dispatch:
inputs:
iota_ref:
description: "Branch / commit to simtest"
type: string
required: true
default: develop
test_num:
description: "MSIM_TEST_NUM (test iterations)"
type: string
required: false
default: "30"

env:
BINARY_LIST_FILE: "./binary-build-list.json"
Expand All @@ -27,6 +38,8 @@ env:
RUSTUP_MAX_RETRIES: 10
# Don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short
IOTA_REF: "${{ github.event.inputs.iota_ref || 'develop' }}"
TEST_NUM: "${{ github.event.inputs.test_num || '30' }}"

jobs:
release:
Expand Down Expand Up @@ -61,6 +74,9 @@ jobs:

tests:
uses: ./.github/workflows/_rust_tests.yml
with:
# simtest job below runs a superset of these tests
runSimtest: false

external-tests:
uses: ./.github/workflows/_external_rust_tests.yml
Expand All @@ -84,3 +100,17 @@ jobs:

split-cluster:
uses: ./.github/workflows/split_cluster.yml

simtest:
timeout-minutes: 240
runs-on: [self-hosted]

steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
ref: ${{ env.IOTA_REF }}
- uses: taiki-e/install-action@375e0c7f08a66b8c2ba7e7eef31a6f91043a81b0 # v2.44.38
with:
tool: nextest
- name: Run simtest
run: scripts/simtest/simtest-run.sh
178 changes: 0 additions & 178 deletions .github/workflows/simulator_nightly.yml

This file was deleted.

4 changes: 2 additions & 2 deletions apps/apps-backend/src/features/features.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ export class FeaturesController {
defaultValue: false,
},
[Feature.StardustMigration]: {
defaultValue: false,
defaultValue: true,
},
[Feature.SupplyIncreaseVesting]: {
defaultValue: false,
defaultValue: true,
},
},
dateUpdated: new Date().toISOString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

import { Button, ButtonType } from '@iota/apps-ui-kit';
import { DarkMode, LightMode } from '@iota/ui-icons';
import { useTheme, Theme, ThemePreference } from '@iota/core';
import { Theme, ThemePreference } from '../../enums';
import { useTheme } from '../../hooks';

export function ThemeSwitcher(): React.JSX.Element {
const { theme, themePreference, setThemePreference } = useTheme();
Expand Down
1 change: 1 addition & 0 deletions apps/core/src/components/buttons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
// SPDX-License-Identifier: Apache-2.0

export * from './ViewTxnOnExplorerButton';
export * from './ThemeSwitcher';
1 change: 1 addition & 0 deletions apps/core/src/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ export * from './useOwnedNFT';
export * from './useNftDetails';
export * from './useCountdownByTimestamp';
export * from './useStakeRewardStatus';
export * from './useRecognizedPackages';

export * from './stake';
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { Feature } from '@iota/core';
import { useFeatureValue } from '@growthbook/growthbook-react';
import { IOTA_FRAMEWORK_ADDRESS, IOTA_SYSTEM_ADDRESS } from '@iota/iota-sdk/utils';
import { Network } from '@iota/iota-sdk/client';
import { Feature, DEFAULT_RECOGNIZED_PACKAGES } from '../../';

import { useNetwork } from './';

const DEFAULT_RECOGNIZED_PACKAGES = [IOTA_FRAMEWORK_ADDRESS, IOTA_SYSTEM_ADDRESS];

export function useRecognizedPackages(): string[] {
const [network] = useNetwork();

export function useRecognizedPackages(network: Network): string[] {
const recognizedPackages = useFeatureValue(
Feature.RecognizedPackages,
DEFAULT_RECOGNIZED_PACKAGES,
Expand Down
21 changes: 14 additions & 7 deletions apps/core/src/utils/migration/createMigrationTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { IotaClient, IotaObjectData } from '@iota/iota-sdk/client';
import { DynamicFieldInfo, IotaClient, IotaObjectData } from '@iota/iota-sdk/client';
import { Transaction } from '@iota/iota-sdk/transactions';
import { STARDUST_PACKAGE_ID } from '../../constants/migration.constants';
import { IOTA_TYPE_ARG } from '@iota/iota-sdk/utils';
Expand All @@ -17,21 +17,28 @@ type NestedResultType = {
NestedResult: [number, number];
};

export async function getNativeTokenTypesFromBag(
bagId: string,
client: IotaClient,
): Promise<string[]> {
export async function getNativeTokensFromBag(bagId: string, client: IotaClient) {
const nativeTokenDynamicFields = await client.getDynamicFields({
parentId: bagId,
});
const nativeTokenTypes: string[] = [];
const nativeTokenTypes: DynamicFieldInfo[] = [];
for (const nativeToken of nativeTokenDynamicFields.data) {
nativeTokenTypes.push(nativeToken?.name?.value as string);
nativeTokenTypes.push(nativeToken);
}

return nativeTokenTypes;
}

export async function getNativeTokenTypesFromBag(
bagId: string,
client: IotaClient,
): Promise<string[]> {
const nativeTokenDynamicFields = await client.getDynamicFields({
parentId: bagId,
});
return nativeTokenDynamicFields.data.map(({ name }) => name.value as string);
}

export function validateBasicOutputObject(outputObject: IotaObjectData): BasicOutputObject {
if (outputObject.content?.dataType !== 'moveObject') {
throw new Error('Invalid basic output object');
Expand Down
14 changes: 10 additions & 4 deletions apps/core/src/utils/parseObjectDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ type ObjectChangeWithObjectType = Extract<
{ objectType: string }
>;

type PackageId = string;
type ModuleName = string;
type TypeName = string;
export function parseObjectChangeDetails(
objectChange: ObjectChangeWithObjectType,
): [string, string, string] {
const [packageId, moduleName, typeName] =
objectChange.objectType?.split('<')[0]?.split('::') || [];
return [packageId, moduleName, typeName];
): [PackageId, ModuleName, TypeName] {
return extractObjectTypeStruct(objectChange.objectType);
}

export function extractObjectTypeStruct(objectType: string): [PackageId, ModuleName, TypeName] {
const [packageId, moduleName, functionName] = objectType?.split('<')[0]?.split('::') || [];
return [packageId, moduleName, functionName];
}
3 changes: 2 additions & 1 deletion apps/explorer/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import { NetworkSelector } from '../network';
import Search from '../search/Search';
import { LinkWithQuery } from '~/components/ui';
import { ThemeSwitcher, ThemedIotaLogo } from '~/components';
import { ThemedIotaLogo } from '~/components';
import { ThemeSwitcher } from '@iota/core';

function Header(): JSX.Element {
return (
Expand Down
1 change: 0 additions & 1 deletion apps/explorer/src/components/header/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
// SPDX-License-Identifier: Apache-2.0

export * from './Header';
export * from './ThemeSwitcher';
Loading

0 comments on commit 6bd49d9

Please sign in to comment.