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

Solidity encoding for XCM types in precompiles utils #1246

Merged
merged 5 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ sp-storage = { version = "13.0.0", git = "https://github.com/paritytech/polkadot
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
sp-version = { version = "22.0.0", git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
sp-weights = { version = "20.0.0", git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
# Substrate FRAME
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }
Expand All @@ -146,6 +147,9 @@ substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/
substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }

# XCM
xcm = { package = "staging-xcm", version = "1.0.0", git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false }

# Frontier Client
fc-api = { version = "1.0.0-dev", path = "client/api" }
fc-cli = { version = "1.0.0-dev", path = "client/cli", default-features = false }
Expand Down
7 changes: 7 additions & 0 deletions precompiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@ sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
sp-weights = { workspace = true }

# Frontier
evm = { workspace = true, features = ["with-codec"] }
fp-evm = { workspace = true }
pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }

# Polkadot / XCM
xcm = { workspace = true, optional = true }

[dev-dependencies]
hex-literal = { workspace = true }
xcm = { workspace = true }

[features]
default = ["std"]
Expand All @@ -49,5 +54,7 @@ std = [
"sp-core/std",
"sp-io/std",
"sp-std/std",
"xcm?/std",
]
codec-xcm = ["xcm"]
testing = ["derive_more", "hex-literal", "scale-info", "serde", "similar-asserts", "std"]
3 changes: 3 additions & 0 deletions precompiles/src/solidity/codec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
pub mod bytes;
pub mod native;

#[cfg(any(feature = "codec-xcm", test))]
pub mod xcm;

use crate::solidity::revert::{MayRevert, RevertReason};
use core::{marker::PhantomData, ops::Range};
use sp_core::{H256, U256};
Expand Down
Loading
Loading