Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zombienet-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
zombienet-sdk
Commits
8255dedc
Unverified
Commit
8255dedc
authored
5 months ago
by
Javier Viola
Committed by
GitHub
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Use node as arg for upgrade (#262)
parent
02eeb166
Branches
Branches containing commit
No related merge requests found
Pipeline
#498119
passed with stage
in 15 minutes and 35 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
crates/orchestrator/src/network/relaychain.rs
+4
-4
4 additions, 4 deletions
crates/orchestrator/src/network/relaychain.rs
crates/orchestrator/src/tx_helper/runtime_upgrade.rs
+8
-5
8 additions, 5 deletions
crates/orchestrator/src/tx_helper/runtime_upgrade.rs
with
12 additions
and
9 deletions
crates/orchestrator/src/network/relaychain.rs
+
4
−
4
View file @
8255dedc
...
...
@@ -43,20 +43,20 @@ impl Relaychain {
options
:
RuntimeUpgradeOptions
,
)
->
Result
<
(),
anyhow
::
Error
>
{
// check if the node is valid first
let
ws_url
=
if
let
Some
(
node_name
)
=
options
.node_name
{
let
node
=
if
let
Some
(
node_name
)
=
options
.node_name
{
if
let
Some
(
node
)
=
self
.nodes
()
.into_iter
()
.find
(|
node
|
node
.name
()
==
node_name
)
{
node
.ws_uri
()
node
}
else
{
return
Err
(
anyhow!
(
"Node: {} is not part of the relaychain"
,
node_name
));
}
}
else
{
// take the first node
if
let
Some
(
node
)
=
self
.nodes
()
.first
()
{
node
.ws_uri
()
node
}
else
{
return
Err
(
anyhow!
(
"Relaychain doesn't have any node!"
));
}
...
...
@@ -72,7 +72,7 @@ impl Relaychain {
let
wasm_data
=
options
.wasm
.get_asset
()
.await
?
;
tx_helper
::
runtime_upgrade
::
upgrade
(
ws_url
,
&
wasm_data
,
&
sudo
)
.await
?
;
tx_helper
::
runtime_upgrade
::
upgrade
(
node
,
&
wasm_data
,
&
sudo
)
.await
?
;
Ok
(())
}
...
...
This diff is collapsed.
Click to expand it.
crates/orchestrator/src/tx_helper/runtime_upgrade.rs
+
8
−
5
View file @
8255dedc
...
...
@@ -2,15 +2,18 @@ use subxt::{dynamic::Value, tx::TxStatus, OnlineClient, SubstrateConfig};
use
subxt_signer
::
sr25519
::
Keypair
;
use
tracing
::{
debug
,
info
};
use
crate
::
network
::
node
::
NetworkNode
;
pub
async
fn
upgrade
(
// options: RuntimeUpgradeOptions,
ws_url
:
&
str
,
node
:
&
NetworkNode
,
wasm_data
:
&
[
u8
],
sudo
:
&
Keypair
,
// scoped_fs: &ScopedFilesystem<'_, impl FileSystem>,
)
->
Result
<
(),
anyhow
::
Error
>
{
debug!
(
"Upgrading runtime, using {} as endpoint "
,
ws_url
);
let
api
=
OnlineClient
::
<
SubstrateConfig
>
::
from_url
(
ws_url
)
.await
?
;
debug!
(
"Upgrading runtime, using node: {} with endpoting {}"
,
node
.name
,
node
.ws_uri
);
let
api
:
OnlineClient
<
SubstrateConfig
>
=
node
.client
()
.await
?
;
let
upgrade
=
subxt
::
dynamic
::
tx
(
"System"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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