Skip to content

Commit

Permalink
Fix merge misses
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Aug 31, 2023
1 parent 71bb6c8 commit 6d33786
Show file tree
Hide file tree
Showing 36 changed files with 57 additions and 224 deletions.
5 changes: 0 additions & 5 deletions .changes/db-migration.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/ledger-nano-events.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/missing-production-profile.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/prepare-output.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/restore-backup.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/stronghold-2.0.md

This file was deleted.

5 changes: 0 additions & 5 deletions bindings/core/src/method/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ pub enum WalletMethod {
/// Read accounts.
/// Expected response: [`Accounts`](crate::Response::Accounts)
GetAccounts,
/// Get historic chrysalis data.
/// Expected response: [`ChrysalisData`](crate::Response::ChrysalisData)
#[cfg(feature = "storage")]
#[cfg_attr(docsrs, doc(cfg(feature = "storage")))]
GetChrysalisData,
/// Consume an account method.
/// Returns [`Response`](crate::Response)
#[serde(rename_all = "camelCase")]
Expand Down
1 change: 0 additions & 1 deletion bindings/core/src/method_handler/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ pub(crate) async fn call_wallet_method_internal(wallet: &Wallet, method: WalletM
}
Response::Accounts(account_dtos)
}
WalletMethod::GetChrysalisData => Response::ChrysalisData(wallet.get_chrysalis_data().await?),
WalletMethod::CallAccountMethod { account_id, method } => {
let account = wallet.get_account(account_id).await?;
call_account_method_internal(&account, method).await?
Expand Down
5 changes: 1 addition & 4 deletions bindings/core/src/response.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use std::collections::HashMap;
#[cfg(not(target_family = "wasm"))]
use std::collections::HashSet;

Expand Down Expand Up @@ -44,6 +43,7 @@ use serde::Serialize;
use {
iota_sdk::types::api::plugins::participation::types::{ParticipationEventId, ParticipationEventStatus},
iota_sdk::wallet::account::{AccountParticipationOverview, ParticipationEventWithNodes},
std::collections::HashMap,
};

use crate::{error::Error, OmittedDebug};
Expand Down Expand Up @@ -260,9 +260,6 @@ pub enum Response {
/// - [`AddressesWithUnspentOutputs`](crate::method::AccountMethod::AddressesWithUnspentOutputs)
AddressesWithUnspentOutputs(Vec<AddressWithUnspentOutputs>),
/// Response for:
/// - [`GetChrysalisData`](crate::method::WalletMethod::GetChrysalisData)
ChrysalisData(Option<HashMap<String, String>>),
/// Response for:
/// - [`MinimumRequiredStorageDeposit`](crate::method::ClientMethod::MinimumRequiredStorageDeposit)
/// - [`ComputeStorageDeposit`](crate::method::UtilsMethod::ComputeStorageDeposit)
MinimumRequiredStorageDeposit(String),
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions bindings/nodejs/lib/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const {
getClientFromWallet,
getSecretManagerFromWallet,
migrateStrongholdSnapshotV2ToV3,
migrateDbChrysalisToStardust,
} = addon;

const callClientMethodAsync = (
Expand Down Expand Up @@ -117,5 +116,4 @@ export {
getSecretManagerFromWallet,
listenMqtt,
migrateStrongholdSnapshotV2ToV3,
migrateDbChrysalisToStardust,
};
2 changes: 0 additions & 2 deletions bindings/nodejs/lib/types/wallet/bridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import type {
__GetAccountMethod__,
__GetAccountIndexesMethod__,
__GetAccountsMethod__,
__GetChrysalisDataMethod__,
__GetLedgerNanoStatusMethod__,
__GenerateEd25519AddressMethod__,
__IsStrongholdPasswordAvailableMethod__,
Expand Down Expand Up @@ -146,7 +145,6 @@ export type __Method__ =
| __GetAccountMethod__
| __GetAccountIndexesMethod__
| __GetAccountsMethod__
| __GetChrysalisDataMethod__
| __GetLedgerNanoStatusMethod__
| __GenerateEd25519AddressMethod__
| __IsStrongholdPasswordAvailableMethod__
Expand Down
4 changes: 0 additions & 4 deletions bindings/nodejs/lib/types/wallet/bridge/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export type __GetAccountMethod__ = {
data: { accountId: AccountIdentifier };
};

export type __GetChrysalisDataMethod__ = {
name: 'getChrysalisData';
};

export type __GetLedgerNanoStatusMethod__ = {
name: 'getLedgerNanoStatus';
};
Expand Down
3 changes: 2 additions & 1 deletion bindings/nodejs/lib/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Output,
IRent,
OutputId,
u64,
} from '../types';
import {
AccountId,
Expand Down Expand Up @@ -142,7 +143,7 @@ export class Utils {
* @param rent Rent cost of objects which take node resources.
* @returns The required storage deposit.
*/
static computeStorageDeposit(output: Output, rent: IRent): bigint {
static computeStorageDeposit(output: Output, rent: IRent): u64 {
const minStorageDepositAmount = callUtilsMethod({
name: 'computeStorageDeposit',
data: {
Expand Down
1 change: 0 additions & 1 deletion bindings/nodejs/lib/wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ export * from './account';
export * from './wallet';
export * from './wallet-method-handler';
export * from '../types/wallet';
export { migrateDbChrysalisToStardust } from '../bindings';
11 changes: 0 additions & 11 deletions bindings/nodejs/lib/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,6 @@ export class Wallet {
return this.methodHandler.getClient();
}

/**
* Get chrysalis data.
*/
async getChrysalisData(): Promise<Record<string, string>> {
const response = await this.methodHandler.callMethod({
name: 'getChrysalisData',
});

return JSON.parse(response).payload;
}

/**
* Get secret manager.
*/
Expand Down
3 changes: 1 addition & 2 deletions bindings/wasm/lib/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { __UtilsMethods__ } from './utils';
// Import needs to be in a single line, otherwise it breaks
// prettier-ignore
// @ts-ignore: path is set to match runtime transpiled js path when bundled.
import { initLogger, createClient, destroyClient, createSecretManager, createWallet, callClientMethodAsync, callSecretManagerMethodAsync, callUtilsMethodRust, callWalletMethodAsync, destroyWallet, listenWalletAsync, getClientFromWallet, getSecretManagerFromWallet, listenMqtt, migrateStrongholdSnapshotV2ToV3, migrateDbChrysalisToStardust } from '../wasm/iota_sdk_wasm';
import { initLogger, createClient, destroyClient, createSecretManager, createWallet, callClientMethodAsync, callSecretManagerMethodAsync, callUtilsMethodRust, callWalletMethodAsync, destroyWallet, listenWalletAsync, getClientFromWallet, getSecretManagerFromWallet, listenMqtt, migrateStrongholdSnapshotV2ToV3 } from '../wasm/iota_sdk_wasm';

const callUtilsMethod = (method: __UtilsMethods__): any => {
const response = JSON.parse(callUtilsMethodRust(JSON.stringify(method)));
Expand All @@ -36,5 +36,4 @@ export {
getSecretManagerFromWallet,
listenMqtt,
migrateStrongholdSnapshotV2ToV3,
migrateDbChrysalisToStardust,
};
11 changes: 0 additions & 11 deletions bindings/wasm/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,3 @@ pub async fn listen_wallet(

Ok(JsValue::UNDEFINED)
}

/// Rocksdb chrysalis migration is not supported for WebAssembly bindings.
///
/// Throws an error if called, only included for compatibility
/// with the Node.js bindings TypeScript definitions.
#[wasm_bindgen(js_name = migrateDbChrysalisToStardust)]
pub fn migrate_db_chrysalis_to_stardust(_storage_path: String, _password: Option<String>) -> Result<(), JsValue> {
let js_error = js_sys::Error::new("Rocksdb chrysalis migration is not supported for WebAssembly");

Err(JsValue::from(js_error))
}
Loading

0 comments on commit 6d33786

Please sign in to comment.