Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
abd92318
Commit
abd92318
authored
1 year ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
check live tests
parent
ce9ccfa5
No related branches found
No related tags found
1 merge request
!229
Upgrade to polkadot-v1.6.0
Pipeline
#35724
passed
1 year ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cargo.lock
+55
-23
55 additions, 23 deletions
Cargo.lock
Cargo.toml
+1
-1
1 addition, 1 deletion
Cargo.toml
live-tests/Cargo.toml
+1
-1
1 addition, 1 deletion
live-tests/Cargo.toml
live-tests/tests/sanity_gdev.rs
+25
-12
25 additions, 12 deletions
live-tests/tests/sanity_gdev.rs
with
82 additions
and
37 deletions
Cargo.lock
+
55
−
23
View file @
abd92318
...
...
@@ -194,7 +194,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
dependencies = [
"num-traits",
"num-traits
0.2.17
",
]
[[package]]
...
...
@@ -298,7 +298,7 @@ dependencies = [
"derivative",
"hashbrown 0.13.2",
"itertools 0.10.5",
"num-traits",
"num-traits
0.2.17
",
"rayon",
"zeroize",
]
...
...
@@ -367,7 +367,7 @@ dependencies = [
"digest 0.10.7",
"itertools 0.10.5",
"num-bigint",
"num-traits",
"num-traits
0.2.17
",
"paste",
"rustc_version",
"zeroize",
...
...
@@ -390,7 +390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565"
dependencies = [
"num-bigint",
"num-traits",
"num-traits
0.2.17
",
"proc-macro2",
"quote",
"syn 1.0.109",
...
...
@@ -480,7 +480,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185"
dependencies = [
"num-traits",
"num-traits
0.2.17
",
"rand 0.8.5",
"rayon",
]
...
...
@@ -553,7 +553,7 @@ dependencies = [
"asn1-rs-impl",
"displaydoc",
"nom",
"num-traits",
"num-traits
0.2.17
",
"rusticata-macros",
"thiserror",
"time",
...
...
@@ -1304,7 +1304,7 @@ dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"num-traits
0.2.17
",
"wasm-bindgen",
"windows-targets 0.52.0",
]
...
...
@@ -1690,6 +1690,15 @@ dependencies = [
"memchr",
]
[[package]]
name = "countmap"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ef2a403c4af585607826502480ab6e453f320c230ef67255eee21f0cc72c0a6"
dependencies = [
"num-traits 0.1.43",
]
[[package]]
name = "cpp_demangle"
version = "0.3.5"
...
...
@@ -2222,7 +2231,7 @@ dependencies = [
"displaydoc",
"nom",
"num-bigint",
"num-traits",
"num-traits
0.2.17
",
"rusticata-macros",
]
...
...
@@ -2370,7 +2379,7 @@ dependencies = [
"fnv",
"hex",
"log",
"num-traits",
"num-traits
0.2.17
",
"parity-scale-codec",
"rayon",
"simple_logger",
...
...
@@ -2567,6 +2576,20 @@ dependencies = [
"tokio",
]
[[package]]
name = "duniter-live-tests"
version = "3.0.0"
dependencies = [
"anyhow",
"countmap",
"hex-literal",
"parity-scale-codec",
"sp-core",
"sp-runtime",
"subxt",
"tokio",
]
[[package]]
name = "duniter-primitives"
version = "3.0.0"
...
...
@@ -2953,7 +2976,7 @@ dependencies = [
"futures 0.3.30",
"futures-timer",
"log",
"num-traits",
"num-traits
0.2.17
",
"parity-scale-codec",
"parking_lot 0.12.1",
"scale-info",
...
...
@@ -2994,7 +3017,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
dependencies = [
"num-traits",
"num-traits
0.2.17
",
]
[[package]]
...
...
@@ -4523,7 +4546,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770"
dependencies = [
"num-traits",
"num-traits
0.2.17
",
]
[[package]]
...
...
@@ -5960,7 +5983,7 @@ dependencies = [
"nalgebra-macros",
"num-complex",
"num-rational",
"num-traits",
"num-traits
0.2.17
",
"simba",
"typenum",
]
...
...
@@ -6188,7 +6211,7 @@ checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
"num-traits
0.2.17
",
]
[[package]]
...
...
@@ -6197,7 +6220,7 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214"
dependencies = [
"num-traits",
"num-traits
0.2.17
",
]
[[package]]
...
...
@@ -6217,7 +6240,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
dependencies = [
"autocfg",
"num-traits",
"num-traits
0.2.17
",
]
[[package]]
...
...
@@ -6229,7 +6252,16 @@ dependencies = [
"autocfg",
"num-bigint",
"num-integer",
"num-traits",
"num-traits 0.2.17",
]
[[package]]
name = "num-traits"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"
dependencies = [
"num-traits 0.2.17",
]
[[package]]
...
...
@@ -7823,7 +7855,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31"
dependencies = [
"num-traits",
"num-traits
0.2.17
",
"rand 0.8.5",
]
...
...
@@ -8625,7 +8657,7 @@ dependencies = [
"log",
"num-bigint",
"num-rational",
"num-traits",
"num-traits
0.2.17
",
"parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
...
...
@@ -9911,7 +9943,7 @@ checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae"
dependencies = [
"approx",
"num-complex",
"num-traits",
"num-traits
0.2.17
",
"paste",
"wide",
]
...
...
@@ -10016,7 +10048,7 @@ dependencies = [
"nom",
"num-bigint",
"num-rational",
"num-traits",
"num-traits
0.2.17
",
"pbkdf2 0.12.2",
"pin-project",
"poly1305",
...
...
@@ -10188,7 +10220,7 @@ version = "16.0.0"
source = "git+https://github.com/duniter/duniter-polkadot-sdk?branch=duniter-substrate-v1.6.0#c84530c57a6f9ab808a92f6b5d29338acf1c6e4f"
dependencies = [
"integer-sqrt",
"num-traits",
"num-traits
0.2.17
",
"parity-scale-codec",
"scale-info",
"serde",
...
...
@@ -12467,7 +12499,7 @@ checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a"
dependencies = [
"downcast-rs",
"libm",
"num-traits",
"num-traits
0.2.17
",
"paste",
]
...
...
This diff is collapsed.
Click to expand it.
Cargo.toml
+
1
−
1
View file @
abd92318
...
...
@@ -156,7 +156,7 @@ members = [
'client/distance'
,
'distance-oracle'
,
'end2end-tests'
,
#
'live-tests',
'live-tests'
,
'pallets/authority-members'
,
'pallets/certification'
,
'pallets/distance'
,
...
...
This diff is collapsed.
Click to expand it.
live-tests/Cargo.toml
+
1
−
1
View file @
abd92318
...
...
@@ -15,5 +15,5 @@ hex-literal = "0.4"
parity-scale-codec
=
"3.4.0"
sp-core
=
{
git
=
'https://github.com/duniter/duniter-polkadot-sdk'
,
branch
=
'duniter-substrate-v1.6.0'
,
default-features
=
false
}
sp-runtime
=
{
git
=
'https://github.com/duniter/duniter-polkadot-sdk'
,
branch
=
'duniter-substrate-v1.6.0'
,
default-features
=
false
,
features
=
[
"std"
]
}
# https://github.com/paritytech/subxt/issues/437
subxt
=
{
git
=
'https://github.com/
paritytech/subxt.git'
,
tag
=
'v0.33
.0'
,
default-features
=
false
,
features
=
[
"substrate-compat"
,
"native"
]
}
subxt
=
{
git
=
'https://github.com/
duniter/subxt'
,
branch
=
'subxt-v0.34.0-duniter-substrate-v1.6
.0'
,
default-features
=
false
,
features
=
[
"substrate-compat"
,
"native"
,
"jsonrpsee"
]
}
tokio
=
{
version
=
"1.28"
,
features
=
[
"macros"
,
"time"
,
"rt-multi-thread"
],
default-features
=
false
}
This diff is collapsed.
Click to expand it.
live-tests/tests/sanity_gdev.rs
+
25
−
12
View file @
abd92318
...
...
@@ -14,6 +14,10 @@
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
// WARNING
// these live test build but I'm not sure they actually test something
// they should be checked against corrupted storage to see that they actually fail
#[subxt::subxt(runtime_metadata_path
=
"../resources/metadata.scale"
)]
pub
mod
gdev
{}
...
...
@@ -22,7 +26,13 @@ use hex_literal::hex;
use
sp_core
::
crypto
::
AccountId32
;
use
sp_core
::{
blake2_128
,
ByteArray
,
H256
};
use
std
::
collections
::{
HashMap
,
HashSet
};
use
subxt
::
backend
::
rpc
::
RpcClient
;
use
subxt
::
config
::
SubstrateConfig
as
GdevConfig
;
use
subxt
::
ext
::
sp_core
;
// use subxt::config::substrate::SubstrateExtrinsicParamsBuilder;
// use subxt::backend::rpc::RpcParams;
// use subxt::config::SubstrateExtrinsicParams;
// use subxt::ext::{sp_core, sp_runtime};
const
DEFAULT_ENDPOINT
:
&
str
=
"ws://localhost:9944"
;
...
...
@@ -58,14 +68,17 @@ struct Storage {
async
fn
main
()
->
anyhow
::
Result
<
()
>
{
let
ws_rpc_endpoint
=
std
::
env
::
var
(
"WS_RPC_ENDPOINT"
)
.unwrap_or_else
(|
_
|
DEFAULT_ENDPOINT
.to_owned
());
let
client
=
Client
::
from_url
(
ws_rpc_endpoint
)
let
rpc
=
Rpc
Client
::
from_url
(
ws_rpc_endpoint
)
.await
.expect
(
"fail to connect to node"
);
.expect
(
"Failed to create the rpc backend"
);
let
client
=
Client
::
from_rpc_client
(
rpc
.clone
())
.await
.unwrap
();
let
maybe_block_hash
=
if
let
Ok
(
block_number
)
=
std
::
env
::
var
(
"AT_BLOCK_NUMBER"
)
{
let
block_number
:
BlockNumber
=
block_number
.parse
()
?
;
println!
(
"Run sanity tests against ĞDev at block #{}."
,
block_number
);
client
.rpc
()
.block_hash
(
Some
(
block_number
.into
()))
.await
?
// FIXME
// client.at(block_number).await?
None
}
else
{
println!
(
"Run sanity tests against ĞDev at last best block"
);
None
...
...
@@ -84,11 +97,11 @@ async fn sanity_tests_at(client: Client, _maybe_block_hash: Option<H256>) -> any
.at_latest
()
.await
.unwrap
()
.iter
(
gdev
::
storage
()
.system
()
.account_
root
(),
100
)
.iter
(
gdev
::
storage
()
.system
()
.account_
iter
()
)
.await
?
;
while
let
Some
((
key
,
account_info
))
=
account_iter
.next
()
.await
?
{
while
let
Some
(
Ok
(
(
key
,
account_info
))
)
=
account_iter
.next
()
.await
{
let
mut
account_id_bytes
=
[
0u8
;
32
];
account_id_bytes
.copy_from_slice
(
&
key
.0
[
48
..
]);
account_id_bytes
.copy_from_slice
(
&
key
[
48
..
]);
accounts
.insert
(
AccountId32
::
new
(
account_id_bytes
),
account_info
);
}
println!
(
"accounts.len(): {}."
,
accounts
.len
());
...
...
@@ -100,11 +113,11 @@ async fn sanity_tests_at(client: Client, _maybe_block_hash: Option<H256>) -> any
.at_latest
()
.await
.unwrap
()
.iter
(
gdev
::
storage
()
.identity
()
.identities_
root
(),
100
)
.iter
(
gdev
::
storage
()
.identity
()
.identities_
iter
()
)
.await
?
;
while
let
Some
((
key
,
idty_value
))
=
idty_iter
.next
()
.await
?
{
while
let
Some
(
Ok
(
(
key
,
idty_value
))
)
=
idty_iter
.next
()
.await
{
let
mut
idty_index_bytes
=
[
0u8
;
4
];
idty_index_bytes
.copy_from_slice
(
&
key
.0
[
40
..
]);
idty_index_bytes
.copy_from_slice
(
&
key
[
40
..
]);
let
idty_val
=
IdtyValue
{
data
:
idty_value
.data
,
next_creatable_identity_on
:
idty_value
.next_creatable_identity_on
,
...
...
@@ -124,11 +137,11 @@ async fn sanity_tests_at(client: Client, _maybe_block_hash: Option<H256>) -> any
.at_latest
()
.await
.unwrap
()
.iter
(
gdev
::
storage
()
.identity
()
.identity_index_of_
root
(),
100
)
.iter
(
gdev
::
storage
()
.identity
()
.identity_index_of_
iter
()
)
.await
?
;
while
let
Some
((
key
,
idty_index
))
=
idty_index_of_iter
.next
()
.await
?
{
while
let
Some
(
Ok
(
(
key
,
idty_index
))
)
=
idty_index_of_iter
.next
()
.await
{
let
mut
blake2_128_bytes
=
[
0u8
;
16
];
blake2_128_bytes
.copy_from_slice
(
&
key
.0
[
32
..
48
]);
blake2_128_bytes
.copy_from_slice
(
&
key
[
32
..
48
]);
identity_index_of
.insert
(
blake2_128_bytes
,
idty_index
);
}
println!
(
"identity_index_of.len(): {}."
,
identity_index_of
.len
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment