Skip to content

Commit 00c9a24

Browse files
authored
shield assets (#1689)
* instantiate assets pallet * listen to ForeignAssets.Transferred events on target_b * skeleton STF for assets * implemented assets functionality. no fees yet * charge fees in same asset * more robust shard vault init * purge earlier * shielding executes * refactor cli directory structure * implement cli functionality for assets * upgrade to XCMv5 * shield-xfer-unshield works for USDC.e * default to native, failover to asset for charging fees * clippy * fix evm fees * get rid of explicit 'unsupported' AssetIf variant * cleanup and alignments * fix runtime * review fixes * map assets per shielding target and support native assets too * fix cli * fixes. native assets tested successfully too * fmt * clippy * additional check * fix tests * fix broken M6 scenario for OCW
1 parent 868880a commit 00c9a24

File tree

63 files changed

+2008
-146
lines changed

Some content is hidden

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

63 files changed

+2008
-146
lines changed

Cargo.lock

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2227,6 +2227,12 @@ version = "0.3.4"
22272227
source = "registry+https://github.com/rust-lang/crates.io-index"
22282228
checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
22292229

2230+
[[package]]
2231+
name = "hex-literal"
2232+
version = "0.4.1"
2233+
source = "registry+https://github.com/rust-lang/crates.io-index"
2234+
checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
2235+
22302236
[[package]]
22312237
name = "hmac"
22322238
version = "0.8.1"
@@ -2578,6 +2584,7 @@ dependencies = [
25782584
"env_logger 0.9.3",
25792585
"hdrhistogram",
25802586
"hex",
2587+
"ita-assets-map",
25812588
"ita-parentchain-interface",
25822589
"ita-stf",
25832590
"itc-rpc-client",
@@ -2590,6 +2597,7 @@ dependencies = [
25902597
"itp-utils",
25912598
"its-primitives",
25922599
"log 0.4.22",
2600+
"pallet-assets",
25932601
"pallet-balances",
25942602
"pallet-enclave-bridge",
25952603
"pallet-evm",
@@ -2763,6 +2771,19 @@ dependencies = [
27632771
"windows-sys 0.48.0",
27642772
]
27652773

2774+
[[package]]
2775+
name = "ita-assets-map"
2776+
version = "0.1.0"
2777+
dependencies = [
2778+
"hex",
2779+
"hex-literal 0.4.1",
2780+
"ita-parentchain-specs",
2781+
"itp-types",
2782+
"parity-scale-codec",
2783+
"scale-info",
2784+
"serde 1.0.193",
2785+
]
2786+
27662787
[[package]]
27672788
name = "ita-oracle"
27682789
version = "0.9.0"
@@ -2788,6 +2809,8 @@ version = "0.9.0"
27882809
dependencies = [
27892810
"bs58",
27902811
"env_logger 0.9.3",
2812+
"hex-literal 0.4.1",
2813+
"ita-assets-map",
27912814
"ita-sgx-runtime",
27922815
"ita-stf",
27932816
"itc-parentchain",
@@ -2828,8 +2851,10 @@ dependencies = [
28282851
"frame-executive",
28292852
"frame-support",
28302853
"frame-system",
2854+
"ita-assets-map",
28312855
"itp-randomness",
28322856
"itp-sgx-runtime-primitives",
2857+
"pallet-assets",
28332858
"pallet-balances",
28342859
"pallet-evm",
28352860
"pallet-guess-the-number",
@@ -2855,6 +2880,7 @@ dependencies = [
28552880
"base58",
28562881
"frame-support",
28572882
"frame-system",
2883+
"ita-assets-map",
28582884
"ita-parentchain-specs",
28592885
"ita-sgx-runtime",
28602886
"itp-hashing",
@@ -3689,6 +3715,7 @@ dependencies = [
36893715
"itp-sgx-runtime-primitives",
36903716
"itp-stf-primitives",
36913717
"itp-utils",
3718+
"pallet-assets",
36923719
"pallet-balances",
36933720
"parity-scale-codec",
36943721
"serde 1.0.193",
@@ -6861,7 +6888,7 @@ dependencies = [
68616888
"der 0.6.1",
68626889
"frame-support",
68636890
"hex",
6864-
"hex-literal",
6891+
"hex-literal 0.3.4",
68656892
"log 0.4.22",
68666893
"parity-scale-codec",
68676894
"ring 0.16.20",

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[workspace]
22
resolver = "2"
33
members = [
4+
"app-libs/assets-map",
45
"app-libs/oracle",
56
"app-libs/parentchain-interface",
67
"app-libs/parentchain-specs",

app-libs/assets-map/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "ita-assets-map"
3+
version = "0.1.0"
4+
authors = ["Integritee AG <[email protected]>"]
5+
edition = "2021"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
11+
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
12+
hex-literal = "0.4.1"
13+
ita-parentchain-specs = { default-features = false, path = "../parentchain-specs" }
14+
itp-types = { default-features = false, path = "../../core-primitives/types" }
15+
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
16+
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
17+
18+
[features]
19+
default = ["std"]
20+
21+
std = [
22+
"codec/std",
23+
"scale-info/std",
24+
"serde/std",
25+
"hex/std",
26+
"ita-parentchain-specs/std",
27+
"itp-types/std",
28+
]

0 commit comments

Comments
 (0)