Ability to send messages from Rialto to Millau (#525)

* relay Rialto messages to Millau

* impl SubmitRialtoToMillauMessage

* fmt
This commit is contained in:
Svyatoslav Nikolsky
2020-11-24 11:01:28 +03:00
committed by Bastian Köcher
parent be56ee51d0
commit fe11f6f1d9
7 changed files with 378 additions and 62 deletions
+42
View File
@@ -108,6 +108,40 @@ pub enum Command {
#[structopt(long)]
fee: bp_millau::Balance,
},
/// Serve given lane of Rialto -> Millau messages.
RialtoMessagesToMillau {
#[structopt(flatten)]
rialto: RialtoConnectionParams,
#[structopt(flatten)]
rialto_sign: RialtoSigningParams,
#[structopt(flatten)]
millau: MillauConnectionParams,
#[structopt(flatten)]
millau_sign: MillauSigningParams,
#[structopt(flatten)]
prometheus_params: PrometheusParams,
/// Hex-encoded id of lane that should be served by relay.
#[structopt(long)]
lane: HexLaneId,
},
/// Submit message to given Rialto -> Millau lane.
SubmitRialtoToMillauMessage {
#[structopt(flatten)]
rialto: RialtoConnectionParams,
#[structopt(flatten)]
rialto_sign: RialtoSigningParams,
#[structopt(flatten)]
millau_sign: MillauSigningParams,
/// Hex-encoded lane id.
#[structopt(long)]
lane: HexLaneId,
/// Message type.
#[structopt(long, possible_values = &ToMillauMessage::variants())]
message: ToMillauMessage,
/// Delivery and dispatch fee.
#[structopt(long)]
fee: bp_rialto::Balance,
},
}
arg_enum! {
@@ -118,6 +152,14 @@ arg_enum! {
}
}
arg_enum! {
#[derive(Debug)]
/// All possible messages that may be delivered to the Millau chain.
pub enum ToMillauMessage {
Remark,
}
}
/// Lane id.
#[derive(Debug)]
pub struct HexLaneId(LaneId);