Skip to content

Commit ca421d6

Browse files
authored
Integrate product core into identity.rs (#1658)
1 parent 7c2b63e commit ca421d6

File tree

225 files changed

+8934
-32683
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+8934
-32683
lines changed

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ jobs:
243243
uses: actions/download-artifact@v4
244244
with:
245245
name: identity-wasm-bindings-build
246-
path: bindings/wasm/
246+
path: bindings/wasm/identity_wasm
247247

248248
- name: Start iota sandbox
249249
uses: './.github/actions/iota-rebase-sandbox/setup'
@@ -260,14 +260,6 @@ jobs:
260260
run: npm ci
261261
working-directory: bindings/wasm/identity_wasm
262262

263-
- name: Install JS dependencies # This is problematic: @iota/iota-sdk seems to not get used from the identity_wasm package, that is why reinstall deps here
264-
run: npm ci
265-
working-directory: bindings/wasm/iota_interaction_ts
266-
267-
- name: Setup link
268-
run: npm link ../iota_interaction_ts
269-
working-directory: bindings/wasm/identity_wasm
270-
271263
- name: Run Wasm examples
272264
run: npm run test:readme && npm run test:node
273265
working-directory: bindings/wasm/identity_wasm
@@ -297,15 +289,7 @@ jobs:
297289
uses: actions/download-artifact@v4
298290
with:
299291
name: identity-wasm-bindings-build
300-
path: bindings/wasm/
301-
302-
- name: Install JS dependencies # This is problematic: @iota/iota-sdk seems to not get used from the identity_wasm package, that is why reinstall deps here
303-
run: npm ci
304-
working-directory: bindings/wasm/iota_interaction_ts
305-
306-
- name: Setup link
307-
run: npm link ../iota_interaction_ts
308-
working-directory: bindings/wasm/identity_wasm
292+
path: bindings/wasm/identity_wasm
309293

310294
- name: Start iota sandbox
311295
uses: './.github/actions/iota-rebase-sandbox/setup'

.github/workflows/shared-build-wasm.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ jobs:
6969
with:
7070
node-version: 20.x
7171

72-
- name: Install JS dependencies
73-
run: npm ci
74-
working-directory: bindings/wasm/iota_interaction_ts
75-
76-
- name: Build IOTA interaction bindings
77-
run: npm run build
78-
working-directory: bindings/wasm/iota_interaction_ts
79-
8072
- name: Install JS dependencies
8173
run: npm ci
8274
working-directory: bindings/wasm/identity_wasm
@@ -104,7 +96,5 @@ jobs:
10496
bindings/wasm/identity_wasm/web
10597
bindings/wasm/identity_wasm/examples/dist
10698
bindings/wasm/identity_wasm/docs
107-
bindings/wasm/iota_interaction_ts/node
108-
bindings/wasm/iota_interaction_ts/web
10999
if-no-files-found: error
110100
retention-days: 1

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ members = [
2323
"identity_ecdsa_verifier",
2424
"identity_eddsa_verifier",
2525
"examples",
26-
"identity_iota_interaction",
27-
"bindings/wasm/iota_interaction_ts",
2826
]
2927

3028
exclude = ["bindings/wasm/identity_wasm", "bindings/grpc"]
3129

3230
[workspace.dependencies]
3331
bls12_381_plus = { version = "0.8.17" }
32+
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.1.0-alpha", package = "iota_interaction" }
33+
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.1.0-alpha", package = "iota_interaction_ts" }
34+
product_common = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.1.0-alpha", package = "product_common" }
3435
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
3536
serde_json = { version = "1.0", default-features = false }
3637
strum = { version = "0.25", default-features = false, features = ["std", "derive"] }
@@ -40,6 +41,7 @@ zkryptium = { version = "0.2.2", default-features = false, features = ["bbsplus"
4041

4142
[workspace.lints.clippy]
4243
result_large_err = "allow"
44+
large_enum_variant = "allow"
4345

4446
[profile.release.package.iota_interaction_ts]
4547
opt-level = 's'

bindings/wasm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Here is an overview of the existing artifacts:
1010
* `identity_wasm`<br>
1111
Exports the IdentityClient to TypeScript using wasm-bindgen generated wasm bindings
1212

13-
* `iota_interaction_ts`<br>
13+
* `iota_move_calls_ts`<br>
1414
Imports TypeScript IOTA Client SDK types using wasm-bindgen generated wasm bindings
15-
and implements identity_iota_interaction traits (among others, IotaClient and MoveCall traits) for wasm32 platforms.
15+
and implements identity_iota_move_calls traits for wasm32 platforms.
1616

1717
## Building an Artifact
1818

bindings/wasm/build/replace_paths.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ function replace(tsconfig, dist, artifact, mode) {
3939
value = path.relative(absoluteFilePath, absoluteIncludePath).replace(/\\/g, "/");
4040
}
4141

42+
if(key.endsWith('*')) {
43+
console.log(`\t dropping '*' from ${key}`);
44+
key = key.slice(0, -1);
45+
}
46+
4247
console.log(`\t replace ${key} with ${value}`);
4348
fileData = fileData.replaceAll(key, value);
4449
}

bindings/wasm/identity_wasm/Cargo.toml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ identity_ecdsa_verifier = { path = "../../../identity_ecdsa_verifier", default-f
2525
identity_eddsa_verifier = { path = "../../../identity_eddsa_verifier", default-features = false, features = ["ed25519"] }
2626
# Remove iota-sdk dependency while working on issue #1445
2727
iota-sdk = { version = "1.1.5", default-features = false, features = ["serde", "std"] }
28+
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.1.0-alpha", package = "iota_interaction", default-features = false }
29+
iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.1.0-alpha", package = "iota_interaction_ts" }
2830
js-sys = { version = "0.3.61" }
2931
json-proof-token = "0.3.4"
3032
proc_typescript = { version = "0.1.0", path = "./proc_typescript" }
33+
product_common = { git = "https://github.com/iotaledger/product-core.git", tag = "v0.1.0-alpha", package = "product_common", features = ["core-client", "transaction"] }
3134
secret-storage = { git = "https://github.com/iotaledger/secret-storage.git", default-features = false, tag = "v0.3.0" }
3235
serde = { version = "1.0", features = ["derive"] }
3336
serde-wasm-bindgen = "0.6.5"
@@ -53,11 +56,6 @@ features = [
5356
"jpt-bbs-plus",
5457
]
5558

56-
# dummy-client dependencies
57-
[dependencies.iota_interaction_ts]
58-
path = "../iota_interaction_ts"
59-
optional = true
60-
6159
[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies]
6260
getrandom_0_2 = { package = "getrandom", version = "0.2", default-features = false, features = ["js"] }
6361
getrandom = { version = "0.3", default-features = false, features = ["wasm_js"] }
@@ -81,6 +79,5 @@ empty_docs = "allow"
8179
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }
8280

8381
[features]
84-
default = ["dummy-client"]
85-
dummy-client = ["dep:iota_interaction_ts"]
86-
keytool = ["dep:iota_interaction_ts", "iota_interaction_ts/keytool", "identity_iota/keytool"]
82+
default = []
83+
keytool = ["iota_interaction_ts/keytool", "identity_iota/keytool"]

0 commit comments

Comments
 (0)