Skip to content

Commit

Permalink
Add pallet-omni-bridge (#3223)
Browse files Browse the repository at this point in the history
* init

* add workspace

* fmt

* fix

* initial impl

* some comment

* Add payout proposal

* comment

* add more ext

* fix bugs

* init tests

* add tests

* refactor omni-bridge

* fix benchmarks

* bump versions

* bump versions

---------

Co-authored-by: WMQ <[email protected]>
  • Loading branch information
Kailai-Wang and wangminqi authored Jan 8, 2025
1 parent fc7d50a commit f82e400
Show file tree
Hide file tree
Showing 14 changed files with 2,032 additions and 309 deletions.
598 changes: 321 additions & 277 deletions parachain/Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ members = [
'pallets/xcm-asset-manager',
'pallets/omni-account',
'pallets/omni-account/runtime-api',
'pallets/omni-bridge',
'precompiles/assets-erc20',
'precompiles/bridge-transfer',
'precompiles/collab-ai/aiusd-convertor',
Expand Down Expand Up @@ -253,6 +254,7 @@ cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/p
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }
assets-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }

substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false }

Expand Down Expand Up @@ -283,6 +285,7 @@ pallet-group = { path = "pallets/group", default-features = false }
pallet-identity-management = { path = "pallets/identity-management", default-features = false }
pallet-omni-account = { path = "pallets/omni-account", default-features = false }
pallet-omni-account-runtime-api = { path = "pallets/omni-account/runtime-api", default-features = false }
pallet-omni-bridge = { path = "pallets/omni-bridge", default-features = false }
pallet-parachain-staking = { path = "pallets/parachain-staking", default-features = false }
pallet-score-staking = { path = "pallets/score-staking", default-features = false }
pallet-teebag = { path = "pallets/teebag", default-features = false }
Expand Down
10 changes: 7 additions & 3 deletions parachain/node/src/chain_specs/paseo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use core_primitives::PASEO_PARA_ID;
use cumulus_primitives_core::ParaId;
use paseo_parachain_runtime::{
AccountId, AuraId, Balance, BalancesConfig, BitacrossConfig, CouncilMembershipConfig,
DeveloperCommitteeMembershipConfig, ParachainInfoConfig, ParachainStakingConfig,
PolkadotXcmConfig, RuntimeGenesisConfig, SessionConfig, SudoConfig,
DeveloperCommitteeMembershipConfig, OmniBridgeConfig, ParachainInfoConfig,
ParachainStakingConfig, PolkadotXcmConfig, RuntimeGenesisConfig, SessionConfig, SudoConfig,
TechnicalCommitteeMembershipConfig, TeebagConfig, TeebagOperationalMode, VCManagementConfig,
WASM_BINARY,
};
Expand Down Expand Up @@ -227,8 +227,12 @@ fn generate_genesis(
admin: Some(root_key.clone()),
mode: TeebagOperationalMode::Development,
},
bitacross: BitacrossConfig { admin: Some(root_key) },
bitacross: BitacrossConfig { admin: Some(root_key.clone()) },
score_staking: Default::default(),
omni_bridge: OmniBridgeConfig {
admin: Some(root_key.clone()),
default_relayers: vec![root_key],
},
};

serde_json::to_value(&config).expect("Could not build genesis config")
Expand Down
50 changes: 50 additions & 0 deletions parachain/pallets/omni-bridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
authors = ['Trust Computing GmbH <[email protected]>']
version = "0.1.0"
edition = "2021"
homepage = 'https://litentry.com'
name = 'pallet-omni-bridge'
repository = 'https://github.com/litentry/heima'

[dependencies]
parity-scale-codec = { workspace = true }
scale-info = { workspace = true }

frame-support = { workspace = true }
frame-system = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
sp-keyring = { workspace = true }
sp-io = { workspace = true, features = ["std"] }
frame-system = { workspace = true, features = ["std"] }
pallet-assets = { workspace = true, features = ["std"] }
pallet-balances = { workspace = true, features = ["std"] }
pallet-timestamp = { workspace = true, features = ["std"] }
hex = { workspace = true }

[features]
default = ["std"]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
std = [
"parity-scale-codec/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-std/std",
"sp-runtime/std",
"frame-support/std",
"frame-system/std",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
Loading

0 comments on commit f82e400

Please sign in to comment.