Skip to content

Commit

Permalink
Merge branch 'dev-tools/fix-more-tests' of https://github.com/iotaled…
Browse files Browse the repository at this point in the history
…ger/iota into dev-tools/fix-more-tests
  • Loading branch information
DaughterOfMars committed Jul 2, 2024
2 parents 1951b9a + c6160e6 commit 02ad4f9
Show file tree
Hide file tree
Showing 252 changed files with 3,155 additions and 3,654 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,8 @@ docs/content/references/framework/**

lcov.info
**/venv/

# iota-private-network
docker/iota-private-network/data
docker/iota-private-network/configs/validators/validator*
docker/iota-private-network/configs/genesis/genesis.blob
4 changes: 2 additions & 2 deletions apps/wallet/configs/webpack/webpack.config.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function generateDateVersion(patch: number) {
}

const WALLET_BETA = process.env.WALLET_BETA === 'true';
const PATCH_VERISON = Number(process.env.PATCH_VERSION) || 0;
const PATCH_VERSION = Number(process.env.PATCH_VERSION) || 0;

const SDK_ROOT = resolve(__dirname, '..', '..', '..', '..', 'sdk');
const PROJECT_ROOT = resolve(__dirname, '..', '..');
Expand Down Expand Up @@ -99,7 +99,7 @@ async function generateAliasFromTs() {

const commonConfig: () => Promise<Configuration> = async () => {
const alias = await generateAliasFromTs();
const walletVersionDetails = generateDateVersion(PATCH_VERISON);
const walletVersionDetails = generateDateVersion(PATCH_VERSION);
const sentryAuthToken = process.env.SENTRY_AUTH_TOKEN;
return {
context: SRC_ROOT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function findAccounts(
getBalance: GetBalanceCallback,
gasTypeArg: string,
): Promise<AccountFromFinder[]> {
// TODO: first check that accounts: Account[] is correctly sorted, if not, throw exception or somethintg
// TODO: first check that accounts: Account[] is correctly sorted, if not, throw exception or something
// Check new addresses for existing accounts
if (addressGapLimit > 0) {
for (const account of accounts) {
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/background/storage-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const MIGRATION_DONE_STORAGE_KEY = 'storage-migration-done';
let statusCache: Status | null = null;

export async function getStatus() {
// placeholde for migration status, always returns ready
// placeholder for migration status, always returns ready
if (statusCache) {
return statusCache;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function getGroupTitle(aGroupAccount: SerializedUIAccount) {
return ACCOUNT_TYPE_TO_LABEL[aGroupAccount?.type] || '';
}

// todo: we probbaly have some duplication here with the various FooterLink / ButtonOrLink
// todo: we probably have some duplication here with the various FooterLink / ButtonOrLink
// components - we should look to add these to base components somewhere
const FooterLink = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonOrLinkProps>(
({ children, to, ...props }, ref) => {
Expand Down
2 changes: 0 additions & 2 deletions crates/iota-aws-orchestrator/assets/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Copyright (c) Mysten Labs, Inc.
# SPDX-License-Identifier: Apache-2.0

# Modifications Copyright (c) 2024 IOTA Stiftung
# SPDX-License-Identifier: Apache-2.0

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-bridge/src/iota_syncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ where

async fn run_event_listening_task(
// The module where interested events are defined.
// Moudle is always of bridge package 0x9.
// Module is always of bridge package 0x9.
module: Identifier,
mut cursor: EventID,
events_sender: mysten_metrics::metered_channel::Sender<(Identifier, Vec<IotaEvent>)>,
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-bridge/src/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ mod tests {

#[tokio::test]
async fn test_iota_watcher_task() {
// Note: this test may fail beacuse of the following reasons:
// Note: this test may fail because of the following reasons:
// the IotaEvent's struct tag does not match the ones in events.rs

let (iota_events_tx, iota_events_rx, _eth_events_tx, eth_events_rx, iota_client, store) =
Expand Down Expand Up @@ -268,7 +268,7 @@ mod tests {

#[tokio::test]
async fn test_eth_watcher_task() {
// Note: this test may fail beacuse of the following reasons:
// Note: this test may fail because of the following reasons:
// 1. Log and BridgeAction returned from `get_test_log_and_action` are not in
// sync
// 2. Log returned from `get_test_log_and_action` is not parseable log (not
Expand Down
1 change: 0 additions & 1 deletion crates/iota-config/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{
path::{Path, PathBuf},
sync::Arc,
time::Duration,
usize,
};

use anyhow::Result;
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3566,12 +3566,12 @@ impl AuthorityState {
.rev()
.skip_while(|d| cursor.is_some() && Some(*d) != cursor)
.skip(usize::from(cursor.is_some()));
return Ok(iter.take(limit.unwrap_or(usize::max_value())).collect());
return Ok(iter.take(limit.unwrap_or(usize::MAX)).collect());
} else {
let iter = iter
.skip_while(|d| cursor.is_some() && Some(*d) != cursor)
.skip(usize::from(cursor.is_some()));
return Ok(iter.take(limit.unwrap_or(usize::max_value())).collect());
return Ok(iter.take(limit.unwrap_or(usize::MAX)).collect());
}
}
self.get_indexes()?
Expand Down
5 changes: 1 addition & 4 deletions crates/iota-core/src/authority/test_authority_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,7 @@ impl<'a> TestAuthorityBuilder<'a> {
None,
)
.unwrap();
let expensive_safety_checks = match self.expensive_safety_checks {
None => ExpensiveSafetyCheckConfig::default(),
Some(config) => config,
};
let expensive_safety_checks = self.expensive_safety_checks.unwrap_or_default();
let cache = Arc::new(ExecutionCache::new_for_tests(
authority_store.clone(),
&registry,
Expand Down
2 changes: 2 additions & 0 deletions crates/iota-core/src/transaction_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub struct TransactionManager {
#[derive(Clone, Debug)]
pub struct PendingCertificateStats {
// The time this certificate enters transaction manager.
#[cfg(test)]
pub enqueue_time: Instant,
// The time this certificate becomes ready for execution.
pub ready_time: Option<Instant>,
Expand Down Expand Up @@ -554,6 +555,7 @@ impl TransactionManager {
expected_effects_digest,
waiting_input_objects: input_object_keys,
stats: PendingCertificateStats {
#[cfg(test)]
enqueue_time: pending_cert_enqueue_time,
ready_time: None,
},
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-framework/docs/iota-framework/kiosk.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ A capability which locks an item and gives a permission to
purchase it from a <code><a href="kiosk.md#0x2_kiosk_Kiosk">Kiosk</a></code> for any price no less than <code>min_price</code>.

Allows exclusive listing: only bearer of the <code><a href="kiosk.md#0x2_kiosk_PurchaseCap">PurchaseCap</a></code> can
purchase the asset. However, the capablity should be used
purchase the asset. However, the capability should be used
carefully as losing it would lock the asset in the <code><a href="kiosk.md#0x2_kiosk_Kiosk">Kiosk</a></code>.

The main application for the <code><a href="kiosk.md#0x2_kiosk_PurchaseCap">PurchaseCap</a></code> is building extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module iota::kiosk {
/// purchase it from a `Kiosk` for any price no less than `min_price`.
///
/// Allows exclusive listing: only bearer of the `PurchaseCap` can
/// purchase the asset. However, the capablity should be used
/// purchase the asset. However, the capability should be used
/// carefully as losing it would lock the asset in the `Kiosk`.
///
/// The main application for the `PurchaseCap` is building extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ module std::vector_tests {
assert!(index == 1, 1);
}

// index_of will return the index first occurence that is equal
// index_of will return the index first occurrence that is equal
#[test]
fun index_of_nonempty_has_multiple_occurences() {
fun index_of_nonempty_has_multiple_occurrences() {
let mut v = vector[];
v.push_back(false);
v.push_back(true);
Expand Down
Loading

0 comments on commit 02ad4f9

Please sign in to comment.