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

refactor: generic extension crate to de-duplicate code between runtimes #163

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
37ad3f3
refactor: separate the extension from runtime
chungquantin Aug 6, 2024
e923898
refactor: trait implemented on enabled features
chungquantin Aug 6, 2024
037adce
fix: move rand to dev-dependencies
chungquantin Aug 6, 2024
a7f05b0
refactor: move extension config out of api
chungquantin Aug 6, 2024
4975ac7
refactor: rename type parameters
chungquantin Aug 7, 2024
87c3549
refactor: enable config based on active feature
chungquantin Aug 7, 2024
963b04b
Merge branch 'daan/api' into chungquantin/refactor-duplicate_chain_ex…
chungquantin Aug 7, 2024
e6a0ec3
refactor: fix handler impl order
chungquantin Aug 7, 2024
a7fd45b
fix: testnet not tesnet
chungquantin Aug 7, 2024
df4793d
refactor: remove call dispatch handler
chungquantin Aug 7, 2024
f1e7267
fix: remove visibility
chungquantin Aug 7, 2024
22f4f5e
refactor: add test module cfg
chungquantin Aug 7, 2024
ab50aa9
fix: add no_std
chungquantin Aug 7, 2024
2e8a252
refactor: remove unused VersionedDispatch
chungquantin Aug 7, 2024
759b5a3
refactor: api & extension
chungquantin Aug 7, 2024
478c027
feat: add extension test for fungible use case
chungquantin Aug 7, 2024
5252737
fix: add comments
chungquantin Aug 7, 2024
7ff1767
fix: build storage import
chungquantin Aug 8, 2024
538a7ed
fix: build storage import
chungquantin Aug 8, 2024
1021fba
refactor: simplify read state handler
chungquantin Aug 8, 2024
2689548
refactor: optimize the state read handler
chungquantin Aug 8, 2024
2fd8bff
fix: add missing decode type in test
chungquantin Aug 8, 2024
34217b2
refactor: optimize read state handler
chungquantin Aug 8, 2024
3d6ee08
refactor: move extension crate to root folder
chungquantin Aug 8, 2024
12f9ef6
fix: remove redundant visibility
chungquantin Aug 9, 2024
b5bd4eb
fix: rename extension crate
chungquantin Aug 9, 2024
75237be
refactor: fungible extension test (#169)
chungquantin Aug 9, 2024
fce8d88
refactor: remove test requires runtime
chungquantin Aug 9, 2024
c28a772
refactor: reorder code position in extension
chungquantin Aug 9, 2024
3894297
refactor: cleanup dependencies & redesign config
chungquantin Aug 11, 2024
a050ecf
docs: api trait comment
chungquantin Aug 11, 2024
af80289
refactor: remove redundant path prefix for Vec
chungquantin Aug 11, 2024
358a04e
fix: missing import
chungquantin Aug 11, 2024
43d92ba
docs: add comment for StateReader
chungquantin Aug 12, 2024
de41a05
refactor: remove config and add generic extension type (#176)
chungquantin Aug 12, 2024
e653f0c
docs: add missing comments
chungquantin Aug 13, 2024
c3b586c
refactor: remove redundant log message
chungquantin Aug 13, 2024
240d00f
Merge branch 'daan/api' into chungquantin/refactor-duplicate_chain_ex…
chungquantin Aug 13, 2024
0ae8fa0
docs: simplify language in the comment
chungquantin Aug 13, 2024
570cc6d
fix: ci error
chungquantin Aug 13, 2024
9a70aeb
fix: resolve ci error
chungquantin Aug 13, 2024
c852ef0
fix: remove a conflicted file import
chungquantin Aug 13, 2024
c83de84
refactor: rearrange dependencies by alphabetical order (#183)
chungquantin Aug 13, 2024
8050b65
fix: rearrange feature order
chungquantin Aug 13, 2024
656f3b4
fix: try-runtime error
chungquantin Aug 13, 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
1,638 changes: 848 additions & 790 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ members = [
"pallets/*",
"primitives",
]
exclude = [
"pop-api",
"tests/contracts"
]
exclude = ["pop-api", "tests/contracts"]

resolver = "2"

[workspace.dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
"derive",
] }
hex-literal = "0.4.1"
log = { version = "0.4.20", default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.10.0", default-features = false, features = [
"derive",
] }
smallvec = "1.11.0"
serde = "1.0.195"
clap = { version = "4.4.18", features = ["derive"] }
Expand All @@ -52,7 +53,8 @@ substrate-build-script-utils = "11.0.0"

# Local
pallet-api = { path = "pallets/api", default-features = false }
pop-runtime-devnet = { path = "runtime/devnet", default-features = true } # default-features=true required for `-p pop-node` builds
pop-chain-extension = { path = "./extension", default-features = false }
pop-runtime-devnet = { path = "runtime/devnet", default-features = true } # default-features=true required for `-p pop-node` builds
pop-runtime-testnet = { path = "runtime/testnet", default-features = true } # default-features=true required for `-p pop-node` builds
pop-runtime-common = { path = "runtime/common", default-features = false }
pop-primitives = { path = "./primitives", default-features = false }
Expand Down Expand Up @@ -82,7 +84,9 @@ frame-system = { version = "29.0.0", default-features = false }
frame-system-benchmarking = { version = "29.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "27.0.0", default-features = false }
frame-try-runtime = { version = "0.35.0", default-features = false }
pallet-aura = { version = "28.0.0", default-features = false, features = ["experimental"] }
pallet-aura = { version = "28.0.0", default-features = false, features = [
"experimental",
] }
pallet-authorship = { version = "29.0.0", default-features = false }
pallet-assets = { version = "30.0.0", default-features = false }
pallet-balances = { version = "29.0.2", default-features = false }
Expand Down Expand Up @@ -139,7 +143,9 @@ xcm-executor = { package = "staging-xcm-executor", version = "8.0.2", default-fe
# Cumulus
asset-test-utils = { version = "8.0.1", default-features = false }
cumulus-pallet-aura-ext = { version = "0.8.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.8.1", default-features = false, features = ["parameterized-consensus-hook"] }
cumulus-pallet-parachain-system = { version = "0.8.1", default-features = false, features = [
"parameterized-consensus-hook",
] }
cumulus-pallet-session-benchmarking = { version = "10.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.8.0", default-features = false }
cumulus-pallet-xcmp-queue = { version = "0.8.0", default-features = false }
Expand All @@ -163,4 +169,4 @@ cumulus-client-service = "0.8.0"
# Paseo
asset-hub-paseo-runtime = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false }
paseo-runtime = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false }
paseo-runtime-constants = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false }
paseo-runtime-constants = { git = "https://github.com/paseo-network/runtimes/", tag = "v1.2.5-system-chains", default-features = false }
51 changes: 51 additions & 0 deletions extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[package]
evilrobot-01 marked this conversation as resolved.
Show resolved Hide resolved
name = "pop-chain-extension"
version = "0.1.0"
authors.workspace = true
description.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
edition.workspace = true
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec.workspace = true
log.workspace = true

# Local
pop-primitives.workspace = true

# Substrate
frame-support.workspace = true
frame-system.workspace = true
pallet-contracts.workspace = true
sp-core.workspace = true
sp-runtime.workspace = true
sp-std.workspace = true

[dev-dependencies]
rand = "0.8.5"

[features]
default = ["std"]
std = [
"log/std",
"codec/std",
"frame-support/std",
"frame-system/std",
"pallet-contracts/std",
"pop-primitives/std",
"sp-runtime/std",
"sp-core/std",
"sp-std/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
Loading
Loading