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
586b23ea
Unverified
Commit
586b23ea
authored
2 years ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
fix live-tests
parent
5922742f
No related branches found
No related tags found
No related merge requests found
Pipeline
#32308
failed
2 years ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Cargo.lock
+7
-10
7 additions, 10 deletions
Cargo.lock
live-tests/Cargo.toml
+5
-4
5 additions, 4 deletions
live-tests/Cargo.toml
live-tests/tests/sanity_gdev.rs
+25
-20
25 additions, 20 deletions
live-tests/tests/sanity_gdev.rs
resources/metadata.scale
+0
-0
0 additions, 0 deletions
resources/metadata.scale
with
37 additions
and
34 deletions
Cargo.lock
+
7
−
10
View file @
586b23ea
...
...
@@ -1962,6 +1962,7 @@ dependencies = [
"portpicker",
"serde_json",
"sp-keyring",
"sp-runtime",
"subxt",
"tokio",
]
...
...
@@ -1971,9 +1972,10 @@ name = "duniter-live-tests"
version = "3.0.0"
dependencies = [
"anyhow",
"hex-literal
0.3.4
",
"hex-literal",
"parity-scale-codec",
"sp-core",
"sp-runtime",
"subxt",
"tokio",
]
...
...
@@ -2913,7 +2915,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal
0.4.1
",
"hex-literal",
"log",
"pallet-atomic-swap",
"pallet-authority-discovery",
...
...
@@ -2980,7 +2982,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal
0.4.1
",
"hex-literal",
"log",
"pallet-atomic-swap",
"pallet-authority-discovery",
...
...
@@ -3281,7 +3283,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal
0.4.1
",
"hex-literal",
"log",
"pallet-atomic-swap",
"pallet-authority-discovery",
...
...
@@ -3448,12 +3450,6 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hex-literal"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
[[package]]
name = "hex-literal"
version = "0.4.1"
...
...
@@ -9917,6 +9913,7 @@ dependencies = [
"getrandom 0.2.10",
"hex",
"impl-serde",
"jsonrpsee",
"parity-scale-codec",
"parking_lot 0.12.1",
"primitive-types",
...
...
This diff is collapsed.
Click to expand it.
live-tests/Cargo.toml
+
5
−
4
View file @
586b23ea
...
...
@@ -10,8 +10,9 @@ version = '3.0.0'
[dev-dependencies]
anyhow
=
"1.0"
hex-literal
=
"0.
3
"
parity-scale-codec
=
"3.
1.5
"
hex-literal
=
"0.
4
"
parity-scale-codec
=
"3.
4.0
"
sp-core
=
{
git
=
'https://github.com/duniter/substrate'
,
branch
=
'duniter-substrate-v0.9.42'
,
default-features
=
false
}
subxt
=
{
git
=
'https://github.com/duniter/subxt'
,
branch
=
'duniter-substrate-v0.9.42'
,
default-features
=
false
}
tokio
=
{
version
=
"1.24.2"
,
features
=
[
"macros"
],
default-features
=
false
}
subxt
=
{
git
=
'https://github.com/duniter/subxt'
,
branch
=
'duniter-substrate-v0.9.42'
,
default-features
=
false
,
features
=
[
"jsonrpsee-ws"
]
}
tokio
=
{
version
=
"1.28"
,
features
=
[
"macros"
,
"time"
,
"rt-multi-thread"
],
default-features
=
false
}
sp-runtime
=
{
git
=
'https://github.com/duniter/substrate'
,
branch
=
'duniter-substrate-v0.9.42'
,
default-features
=
false
,
features
=
[
"std"
]
}
# https://github.com/paritytech/subxt/issues/437
\ No newline at end of file
This diff is collapsed.
Click to expand it.
live-tests/tests/sanity_gdev.rs
+
25
−
20
View file @
586b23ea
...
...
@@ -72,18 +72,17 @@ async fn main() -> anyhow::Result<()> {
sanity_tests_at
(
client
,
maybe_block_hash
)
.await
}
async
fn
sanity_tests_at
(
client
:
Client
,
maybe_block_hash
:
Option
<
H256
>
)
->
anyhow
::
Result
<
()
>
{
async
fn
sanity_tests_at
(
client
:
Client
,
_
maybe_block_hash
:
Option
<
H256
>
)
->
anyhow
::
Result
<
()
>
{
// ===== Collect storage ===== //
// Collect accounts
let
mut
accounts
=
HashMap
::
new
();
let
mut
accounts
:
HashMap
<
AccountId32
,
AccountInfo
>
=
HashMap
::
new
();
let
mut
account_iter
=
client
.storage
()
.iter
(
gdev
::
storage
()
.system
()
.account_root
(),
100
,
maybe_block_hash
,
)
.at_latest
()
.await
.unwrap
()
.iter
(
gdev
::
storage
()
.system
()
.account_root
(),
100
)
.await
?
;
while
let
Some
((
key
,
account_info
))
=
account_iter
.next
()
.await
?
{
let
mut
account_id_bytes
=
[
0u8
;
32
];
...
...
@@ -93,31 +92,37 @@ async fn sanity_tests_at(client: Client, maybe_block_hash: Option<H256>) -> anyh
println!
(
"accounts: {}."
,
accounts
.len
());
// Collect identities
let
mut
identities
=
HashMap
::
new
();
let
mut
identities
:
HashMap
<
IdtyIndex
,
IdtyValue
>
=
HashMap
::
new
();
let
mut
idty_iter
=
client
.storage
()
.iter
(
gdev
::
storage
()
.identity
()
.identities_root
(),
100
,
maybe_block_hash
,
)
.at_latest
()
.await
.unwrap
()
.iter
(
gdev
::
storage
()
.identity
()
.identities_root
(),
100
)
.await
?
;
while
let
Some
((
key
,
idty_value
))
=
idty_iter
.next
()
.await
?
{
let
mut
idty_index_bytes
=
[
0u8
;
4
];
idty_index_bytes
.copy_from_slice
(
&
key
.0
[
40
..
]);
identities
.insert
(
IdtyIndex
::
from_le_bytes
(
idty_index_bytes
),
idty_value
);
let
idty_val
=
IdtyValue
{
data
:
idty_value
.data
,
next_creatable_identity_on
:
idty_value
.next_creatable_identity_on
,
old_owner_key
:
None
,
// Not used in the live test, skip the conversion
owner_key
:
AccountId32
::
from
(
idty_value
.owner_key
.0
),
removable_on
:
idty_value
.removable_on
,
status
:
idty_value
.status
,
};
identities
.insert
(
IdtyIndex
::
from_le_bytes
(
idty_index_bytes
),
idty_val
);
}
println!
(
"identities: {}."
,
identities
.len
());
// Collect identity_index_of
let
mut
identity_index_of
=
HashMap
::
new
();
let
mut
identity_index_of
:
HashMap
<
[
u8
;
16
],
IdtyIndex
>
=
HashMap
::
new
();
let
mut
idty_index_of_iter
=
client
.storage
()
.iter
(
gdev
::
storage
()
.identity
()
.identity_index_of_root
(),
100
,
maybe_block_hash
,
)
.at_latest
()
.await
.unwrap
()
.iter
(
gdev
::
storage
()
.identity
()
.identity_index_of_root
(),
100
)
.await
?
;
while
let
Some
((
key
,
idty_index
))
=
idty_index_of_iter
.next
()
.await
?
{
let
mut
blake2_128_bytes
=
[
0u8
;
16
];
...
...
This diff is collapsed.
Click to expand it.
resources/metadata.scale
+
0
−
0
View file @
586b23ea
No preview for this file type
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