Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
[zombinet] initial implementation of zombienet backchannel (#4377)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola authored Jan 7, 2022
1 parent be0b5d3 commit bf91476
Show file tree
Hide file tree
Showing 5 changed files with 430 additions and 1 deletion.
210 changes: 209 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ members = [
"node/test/polkadot-simnet/common",
"node/test/polkadot-simnet/node",
"node/test/polkadot-simnet/test",
"node/zombienet-backchannel",
"parachain/test-parachains",
"parachain/test-parachains/adder",
"parachain/test-parachains/adder/collator",
Expand Down
22 changes: 22 additions & 0 deletions node/zombienet-backchannel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "zombienet-backchannel"
description = "Zombienet backchannel to notify test runner and coordinate with malus actors."
license = "GPL-3.0-only"
version = "0.9.13"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
readme = "README.md"
publish = false

[dependencies]
tokio = { version = "1.0.0", default-features = false, features = ["macros", "net", "rt-multi-thread", "sync"] }
url = "2.0.0"
tokio-tungstenite = "0.16"
futures-util = "0.3.18"
lazy_static = "1.4.0"
parity-scale-codec = { version = "2.3.1", features = ["derive"] }
reqwest = "0.11"
thiserror = "1.0.30"
tracing = "0.1.26"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
39 changes: 39 additions & 0 deletions node/zombienet-backchannel/src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

//! Polkadot Zombienet Backchannel error definitions.

#[derive(Debug, thiserror::Error)]
#[allow(missing_docs)]
pub enum BackchannelError {
#[error("Error connecting websocket server")]
CantConnectToWS,

#[error("Backchannel not initialized yet")]
Uninitialized,

#[error("Backchannel already initialized")]
AlreadyInitialized,

#[error("Error sending new value to backchannel")]
SendItemFail,

#[error("Invalid host for connection backchannel")]
InvalidHost,

#[error("Invalid port for connection backchannel")]
InvalidPort,
}
Loading

0 comments on commit bf91476

Please sign in to comment.