Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add AssetTransactor implementation with XCM #145

Merged
merged 31 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
568c5ae
add asset transactor and the structure
freddyli7 Nov 2, 2023
3044a0e
add generic type for XCM asset transactor with forwarder traits
freddyli7 Nov 3, 2023
1697156
add bridge forward with trait
freddyli7 Nov 6, 2023
077a55d
added xcm bridge
freddyli7 Nov 7, 2023
da30fb9
add xcm message struct and execution logic
freddyli7 Nov 28, 2023
c44dfbf
add xcm transfer logic
freddyli7 Dec 4, 2023
3939b6c
add 3 types of asset transfer impl
Dec 4, 2023
f094d6b
finish the transfer kind logic
Dec 5, 2023
f2c5117
minor fix
Dec 5, 2023
7be8f18
add mock runtime for xcm bridge pallet
Dec 8, 2023
73dd70f
add dest extract logic
Dec 11, 2023
41d492e
runtime fix
Dec 13, 2023
de53522
add tmp account encode logic
Dec 14, 2023
a9071e0
runtime fix
Jan 2, 2024
aa4ff9b
fix the compile errors in xcm bridge
Jan 3, 2024
9fb92c9
impl the missing logic for events and sygma multilocation pattern
Jan 4, 2024
be06eff
fix the substrate dependency compile issue
Jan 5, 2024
8841e9a
add relay chain setup
Jan 9, 2024
771cf13
add parachain setup for unit test
Jan 10, 2024
674b1bc
add xcm bridge unit tests
Jan 12, 2024
c310a89
adject the local mock runtime impl for xcm bridge
Jan 15, 2024
e0971fc
fix the xcm bridge runtime and add event
Jan 17, 2024
5446b05
refacot the forwarder
Jan 18, 2024
18bb1cc
add unit test with runtime for brdige forwarder
Jan 19, 2024
0459044
unit test for bridge pallet transfer method and xcm asset transactor
Jan 22, 2024
ac9ec82
finish the unit test for bridge forwarder
Jan 23, 2024
ed06a6a
fix the unit tests
Jan 29, 2024
4f1cd1a
rebase from Polkadot v1.2.0
Jan 29, 2024
21beac3
add xcm weight
Jan 30, 2024
e59ed89
adjust the forwarder multilocaiton condition
Jan 31, 2024
905412f
pr comments fix
Feb 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
544 changes: 358 additions & 186 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ members = [
"substrate-node/node",
"substrate-node/runtime",
"parachain-info",
"bridge-forwarder",
"xcm-bridge"
]

exclude = [
Expand Down
71 changes: 71 additions & 0 deletions bridge-forwarder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[package]
name = "sygma-bridge-forwarder"
version = "0.3.0"
edition = "2021"
license = "LGPL-3.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde", "decode"] }
hex-literal = { version = "0.3", default-features = false }

# Substrate
frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }

# Polkadot
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }

# Cumulus
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0", default-features = false }

# Local
sygma-traits = { path = "../traits", default-features = false }

[dev-dependencies]
# Substrate
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }
pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }
pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }

# Polkadot
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", branch = "release-polkadot-v1.2.0" }

# Local
sygma-traits = { path = "../traits" }
pallet-parachain-info = { path = "../parachain-info" }

[features]
default = ["std"]
std = [
"codec/std",
"scale-info/std",
"frame-support/std",
"frame-system/std",
"sp-std/std",
"sp-io/std",
"xcm/std",
"xcm-builder/std",
"xcm-executor/std",
"cumulus-primitives-core/std",
"cumulus-primitives-utility/std",
"cumulus-pallet-xcm/std",
"sygma-traits/std",
]
runtime-benchmarks = [
'frame-support/runtime-benchmarks',
'frame-system/runtime-benchmarks',
]
try-runtime = ["frame-support/try-runtime"]
Loading
Loading