Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Commit b55dfc9

Browse files
tikhonoborispovod
andauthored
[WIP] VM pallet tests refactor (#177)
* remove unused * update all deps links in https * change deps and paths to one format * lock * reduce complexity * remove unchecked * remove unchecked in publish * add new test, rearrange existing for easy reading * remove unnecessary root code * remove root_ps * remove origin_ps_acc that dublicate bob_public_key * add runtime builder * refactoring: comments, file renames, removed useless balances, etc Co-authored-by: borispovod <[email protected]>
1 parent 3478d81 commit b55dfc9

File tree

23 files changed

+1391
-1539
lines changed

23 files changed

+1391
-1539
lines changed

Cargo.lock

Lines changed: 685 additions & 678 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/Cargo.toml

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ version = '0.5.0'
1111

1212
[[bin]]
1313
name = 'pontem'
14-
path = 'src/main.rs'
14+
path = "src/main.rs"
1515

1616
[package.metadata.docs.rs]
1717
targets = ['x86_64-unknown-linux-gnu']
1818

1919
[build-dependencies]
20-
substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
20+
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
2121
stdlib-fetch = { path = "../utils/stdlib-fetch" }
2222

2323
[dependencies]
@@ -31,70 +31,70 @@ log = "0.4"
3131
serde = { version = "1.0", features = ["derive"] }
3232

3333
# Substrate dependencies
34-
frame-benchmarking = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
35-
frame-benchmarking-cli = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
36-
pallet-transaction-payment-rpc = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
37-
substrate-frame-rpc-system = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
38-
substrate-prometheus-endpoint = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
34+
frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
35+
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
36+
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
37+
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
38+
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
3939

4040
# Substarte Client Dependencies
41-
sc-basic-authorship = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
42-
sc-cli = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
43-
sc-client-api = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
44-
sc-consensus = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
45-
sc-executor = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
46-
sc-finality-grandpa = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
47-
sc-keystore = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
48-
sc-rpc = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
49-
sc-rpc-api = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
50-
sc-service = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
51-
sc-telemetry = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
52-
sc-transaction-pool = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
53-
sc-tracing = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
54-
sc-chain-spec = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
55-
sc-network = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
56-
sc-transaction-pool-api = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
57-
sc-consensus-manual-seal = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
41+
sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
42+
sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
43+
sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
44+
sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
45+
sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
46+
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
47+
sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
48+
sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
49+
sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
50+
sc-service = { git = "https://github.com/paritytech/substrate.git", branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
51+
sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
52+
sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
53+
sc-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
54+
sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
55+
sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
56+
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
57+
sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
5858

5959
# Substrate Primitive Dependencies
60-
sp-api = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
61-
sp-block-builder = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
62-
sp-blockchain = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
63-
sp-consensus = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
64-
sp-core = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
65-
sp-finality-grandpa = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
66-
sp-inherents = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
67-
sp-runtime = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
68-
sp-transaction-pool = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
69-
sp-timestamp = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
70-
sp-session = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
71-
sp-offchain = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
72-
sp-keystore = { git = 'http://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
60+
sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
61+
sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
62+
sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
63+
sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
64+
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
65+
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
66+
sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
67+
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
68+
sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
69+
sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
70+
sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
71+
sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
72+
sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
7373

7474
# Nimbus dependencies
75-
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus", branch = 'polkadot-v0.9.13' }
76-
nimbus-consensus = { git = "https://github.com/pontem-network/nimbus", branch = 'polkadot-v0.9.13' }
75+
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus.git", branch = "polkadot-v0.9.13" }
76+
nimbus-consensus = { git = "https://github.com/pontem-network/nimbus.git", branch = "polkadot-v0.9.13" }
7777

7878
# Cumulus dependencies
79-
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus", branch = 'polkadot-v0.9.13' }
80-
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = 'polkadot-v0.9.13' }
81-
cumulus-client-network = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.13' }
82-
cumulus-client-service = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.13' }
83-
cumulus-client-cli = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.13' }
84-
cumulus-primitives-core = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.13' }
85-
cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.13' }
79+
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
80+
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
81+
cumulus-client-network = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
82+
cumulus-client-service = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
83+
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
84+
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
85+
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
8686

8787
# Polkadot dependencies
88-
polkadot-primitives = { git = 'http://github.com/paritytech/polkadot.git', branch = 'release-v0.9.13' }
89-
polkadot-service = { git = 'http://github.com/paritytech/polkadot.git', branch = 'release-v0.9.13' }
90-
polkadot-parachain = { git = 'http://github.com/paritytech/polkadot.git', branch = 'release-v0.9.13' }
88+
polkadot-primitives = { git = "https://github.com/paritytech/polkadot.git", branch = "release-v0.9.13" }
89+
polkadot-service = { git = "https://github.com/paritytech/polkadot.git", branch = "release-v0.9.13" }
90+
polkadot-parachain = { git = "https://github.com/paritytech/polkadot.git", branch = "release-v0.9.13" }
9191

9292
# Local dependencies
93-
pontem-runtime = { path = '../runtime' }
94-
sp-mvm-rpc = { path = '../pallets/sp-mvm/rpc' }
95-
sp-mvm-rpc-runtime = { path = '../pallets/sp-mvm/rpc/runtime' }
96-
primitives = { path = '../primitives' }
97-
constants = { path = '../constants' }
93+
pontem-runtime = { path = "../runtime" }
94+
sp-mvm-rpc = { path = "../pallets/sp-mvm/rpc" }
95+
sp-mvm-rpc-runtime = { path = "../pallets/sp-mvm/rpc/runtime" }
96+
primitives = { path = "../primitives" }
97+
constants = { path = "../constants" }
9898

9999

100100
# FIXME: You MUST set the relay chain networks you wish to target in the `features` here
@@ -105,7 +105,8 @@ constants = { path = '../constants' }
105105
#
106106
# ** Don't enable relay chains you don't need, as this is a **very** heavy build for no reason**
107107
# More info: https://github.com/paritytech/polkadot/pull/3189
108-
polkadot-cli = { git = 'http://github.com/paritytech/polkadot.git', branch = 'release-v0.9.13', features = ["kusama-native"] }
108+
109+
polkadot-cli = { git = 'https://github.com/paritytech/polkadot.git', branch = 'release-v0.9.13', features = ["kusama-native"] }
109110

110111
[dependencies.move-vm]
111112
package = "mvm"

pallets/author-mapping/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description = "Maps AuthorIds to AccountIds Useful for associating consensus aut
77

88
[dependencies]
99
log = { version = "0.4", default-features = false }
10-
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus", branch = "polkadot-v0.9.13", default-features = false }
10+
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus.git", branch = "polkadot-v0.9.13", default-features = false }
1111
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
1212
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
1313
parity-scale-codec = { version = "2.0.0", default-features = false, features=["derive"] }

pallets/currencies/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "pol
1717
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
1818

1919
# Orml dependencies
20-
orml-traits = { default-features = false, git = 'https://github.com/open-web3-stack/open-runtime-module-library', rev = '88f1b4b1ac6ea0621d188dfa7e64fd2915dd81d5' }
21-
orml-utilities = { default-features = false, git = 'https://github.com/open-web3-stack/open-runtime-module-library', rev = '88f1b4b1ac6ea0621d188dfa7e64fd2915dd81d5' }
20+
orml-traits = { default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "88f1b4b1ac6ea0621d188dfa7e64fd2915dd81d5" }
21+
orml-utilities = { default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "88f1b4b1ac6ea0621d188dfa7e64fd2915dd81d5" }
2222

2323
# Local dependencies
2424
primitives = { default-features = false, path = "../../primitives" }
@@ -27,7 +27,7 @@ primitives = { default-features = false, path = "../../primitives" }
2727
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
2828
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
2929
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
30-
orml-tokens = { default-features = false, git = 'https://github.com/open-web3-stack/open-runtime-module-library', rev = '88f1b4b1ac6ea0621d188dfa7e64fd2915dd81d5' }
30+
orml-tokens = { default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "88f1b4b1ac6ea0621d188dfa7e64fd2915dd81d5" }
3131

3232
[features]
3333
default = ["std"]

pallets/groupsign/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ targets = ["x86_64-unknown-linux-gnu"]
1414
[dependencies]
1515
codec = { default-features = false , package = "parity-scale-codec", version = "2.3.1" }
1616
scale-info = { default-features = false, version = "1.0", features = ["derive"] }
17-
frame-support = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
18-
frame-system = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
17+
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
18+
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
1919

20-
sp-io = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
21-
sp-std = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
22-
sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
23-
sp-runtime = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
20+
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
21+
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
22+
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
23+
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
2424
getrandom = { version = "0.2.3", optional = true }
2525

2626
[dev-dependencies]
27-
sp-keystore = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.13' }
27+
sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
2828

2929
[features]
3030
default = ['std']

pallets/parachain-staking/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch =
1010
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
1111
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
1212
log = "0.4"
13-
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus", branch = "polkadot-v0.9.13", default-features = false }
13+
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus.git", branch = "polkadot-v0.9.13", default-features = false }
1414
parity-scale-codec = { version = "2.2", default-features = false, features = ["derive"] }
1515
serde = { version = "1.0.101", optional = true }
1616
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }

0 commit comments

Comments
 (0)