Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
UMR1352 committed Jan 24, 2025
1 parent b17ef0b commit 1b032ce
Show file tree
Hide file tree
Showing 18 changed files with 534 additions and 479 deletions.
10 changes: 6 additions & 4 deletions bindings/wasm/build/node.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const path = require("path");
const fs = require("fs");
const {lintAll} = require("./lints");
const { lintAll } = require("./lints");
const generatePackage = require("./utils/generatePackage");

const artifact = process.argv[2];

const RELEASE_FOLDER = path.join(__dirname, "..", artifact, "node");
const entryFilePathNode = path.join(RELEASE_FOLDER, `${artifact}.js`);
const entryFileNode = fs.readFileSync(entryFilePathNode).toString();
console.log(`[build/node.js] Processing entryFile '${entryFilePathNode}' for artifact '${artifact}'`,)
console.log(`[build/node.js] Processing entryFile '${entryFilePathNode}' for artifact '${artifact}'`);

lintAll(entryFileNode);

Expand All @@ -29,7 +29,9 @@ fs.writeFileSync(
entryFilePathNode,
changedFileNode,
);
console.log(`[build/node.js] Added node-fetch polyfill to entryFile '${entryFilePathNode}'. Starting generatePackage().`,)
console.log(
`[build/node.js] Added node-fetch polyfill to entryFile '${entryFilePathNode}'. Starting generatePackage().`,
);

// Generate `package.json`.
const newPackage = generatePackage({
Expand All @@ -38,4 +40,4 @@ const newPackage = generatePackage({
artifact,
});
fs.writeFileSync(path.join(RELEASE_FOLDER, "package.json"), JSON.stringify(newPackage, null, 2));
console.log(`[build/node.js] Finished processing entryFile '${entryFilePathNode}' for artifact '${artifact}'`,)
console.log(`[build/node.js] Finished processing entryFile '${entryFilePathNode}' for artifact '${artifact}'`);
10 changes: 5 additions & 5 deletions bindings/wasm/build/web.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
const path = require("path");
const fs = require("fs");
const fse = require("fs-extra");
const {lintAll} = require("./lints");
const { lintAll } = require("./lints");
const generatePackage = require("./utils/generatePackage");

const artifact = process.argv[2];

const RELEASE_FOLDER = path.join(__dirname, "..", artifact, "web");
const entryFilePath = path.join(RELEASE_FOLDER, `${artifact}.js`);
const entryFile = fs.readFileSync(entryFilePath).toString();
console.log(`[build/web.js] Processing entryFile '${entryFilePath}' for artifact '${artifact}'`,)
console.log(`[build/web.js] Processing entryFile '${entryFilePath}' for artifact '${artifact}'`);

lintAll(entryFile);

Expand All @@ -29,7 +29,7 @@ fs.writeFileSync(
entryFilePath,
changedFile,
);
console.log(`[build/web.js] Commented out webpack workaround for '${entryFilePath}'.`,)
console.log(`[build/web.js] Commented out webpack workaround for '${entryFilePath}'.`);

const entryFilePathTs = path.join(RELEASE_FOLDER, `${artifact}.d.ts`);
const entryFileTs = fs.readFileSync(entryFilePathTs).toString();
Expand All @@ -47,7 +47,7 @@ fs.writeFileSync(
entryFilePathTs,
changedFileTs,
);
console.log(`[build/web.js] Created init function for '${entryFilePathTs}'. Starting generatePackage().`,)
console.log(`[build/web.js] Created init function for '${entryFilePathTs}'. Starting generatePackage().`);

// Generate `package.json`.
const newPackage = generatePackage({
Expand All @@ -56,4 +56,4 @@ const newPackage = generatePackage({
artifact,
});
fs.writeFileSync(path.join(RELEASE_FOLDER, "package.json"), JSON.stringify(newPackage, null, 2));
console.log(`[build/web.js] Finished processing entryFile '${entryFilePathNode}' for artifact '${artifact}'`,)
console.log(`[build/web.js] Finished processing entryFile '${entryFilePathNode}' for artifact '${artifact}'`);
6 changes: 3 additions & 3 deletions bindings/wasm/identity_wasm/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {defineConfig} from "cypress";
import { defineConfig } from "cypress";

export default defineConfig({
screenshotOnRunFailure: false,
Expand All @@ -17,13 +17,13 @@ export default defineConfig({
// https://github.com/cypress-io/cypress/issues/18217
launchOptions.preferences[
"network.proxy.testing_localhost_is_secure_when_hijacked"
] = true;
] = true;
// Temporary fix to allow cypress to control Firefox via CDP
// https://github.com/cypress-io/cypress/issues/29713
// https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/
launchOptions.preferences[
"remote.active-protocols"
] = 3;
] = 3;
}
return launchOptions;
});
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/identity_wasm/lib/iota_identity_client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import {IIotaIdentityClient, IotaDID, IotaDocument, IotaIdentityClientExt} from "~identity_wasm";
import { IIotaIdentityClient, IotaDID, IotaDocument, IotaIdentityClientExt } from "~identity_wasm";

import {
Address,
Expand Down Expand Up @@ -159,7 +159,7 @@ export class IotaIdentityClient implements IIotaIdentityClient {
if (networkHrp !== did.network()) {
throw new Error(
"deleteDidOutput: DID network mismatch, client expected `" + networkHrp + "`, DID network is `"
+ did.network() + "`",
+ did.network() + "`",
);
}

Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/identity_wasm/lib/jwk_storage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as ed from "@noble/ed25519";
import {decodeB64, encodeB64, Jwk, JwkGenOutput, JwkStorage, ProofAlgorithm, ProofUpdateCtx} from "~identity_wasm";
import {EdCurve, JwkType, JwsAlgorithm} from "./jose";
import { decodeB64, encodeB64, Jwk, JwkGenOutput, JwkStorage, ProofAlgorithm, ProofUpdateCtx } from "~identity_wasm";
import { EdCurve, JwkType, JwsAlgorithm } from "./jose";

type Ed25519PrivateKey = Uint8Array;
type Ed25519PublicKey = Uint8Array;
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/identity_wasm/lib/key_id_storage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {encode as base64Encode} from "base64-arraybuffer";
import type {KeyIdStorage, MethodDigest} from "~identity_wasm";
import { encode as base64Encode } from "base64-arraybuffer";
import type { KeyIdStorage, MethodDigest } from "~identity_wasm";

export class KeyIdMemStore implements KeyIdStorage {
private _keyIds: Map<string, string>;
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/iota_interaction_ts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ js-sys = { version = "0.3.61" }
secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", default-features = false, tag = "v0.1.0" }
serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = "0.6.5"
serde_json.workspace = true
thiserror.workspace = true
tsify = "0.4.5"
wasm-bindgen = { version = "=0.2.93", features = ["serde-serialize"] }
wasm-bindgen-futures = { version = "0.4", default-features = false }
zkryptium = "0.2.2"
serde_json.workspace = true

[dependencies.identity_iota_interaction]
path = "../../../identity_iota_interaction"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class IotaTransactionBlockResponseAdapter {
}

get_response(): IotaTransactionBlockResponse {
return this.response
return this.response;
}
}

Expand Down
6 changes: 3 additions & 3 deletions identity_iota/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ iota-client = [

# Enables revocation with `RevocationBitmap2022`.
revocation-bitmap = [
"identity_credential/revocation-bitmap",
"identity_iota_core/revocation-bitmap",
"identity_resolver?/revocation-bitmap",
"identity_credential/revocation-bitmap",
"identity_iota_core/revocation-bitmap",
"identity_resolver?/revocation-bitmap",
]

# Enables revocation with `StatusList2021`.
Expand Down
5 changes: 4 additions & 1 deletion identity_iota_core/src/rebased/proposals/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ where
controller_cap_ref,
proposal_id,
object_data_list,
borrow_action.0.intent_fn.expect("BorrowActionWithIntent makes sure intent_fn is there"),
borrow_action
.0
.intent_fn
.expect("BorrowActionWithIntent makes sure intent_fn is there"),
client.package_id(),
)
.map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?;
Expand Down
5 changes: 4 additions & 1 deletion identity_iota_core/src/rebased/proposals/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ where
controller_cap_ref,
proposal_id,
borrowing_controller_cap_ref,
action.0.intent_fn.expect("BorrowActionWithIntent makes sure intent_fn is present"),
action
.0
.intent_fn
.expect("BorrowActionWithIntent makes sure intent_fn is present"),
client.package_id(),
)
.map_err(|e| Error::TransactionBuildingFailed(e.to_string()))?;
Expand Down
2 changes: 1 addition & 1 deletion identity_iota_interaction/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ignore = [
"src/sdk_types",
"src/sdk_types",
]
Loading

0 comments on commit 1b032ce

Please sign in to comment.