Pay dispatch fee at target chain cli option (#1043)

* dispatch-fee-payment=at-target-chain cli option

* generate at-target-chain messages

* Update relays/bin-substrate/src/cli/send_message.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
Svyatoslav Nikolsky
2021-07-15 12:08:39 +03:00
committed by Bastian Köcher
parent f5f73537a8
commit 88ee6bd6a0
4 changed files with 85 additions and 9 deletions
@@ -19,7 +19,9 @@
use crate::cli::{
bridge,
encode_call::{self, Call, CliEncodeCall},
encode_message, send_message, CliChain,
encode_message,
send_message::{self, DispatchFeePayment},
CliChain,
};
use bp_message_dispatch::{CallOrigin, MessagePayload};
use codec::Decode;
@@ -95,7 +97,13 @@ impl CliChain for Rialto {
let call = Target::encode_call(&call).map_err(|e| e.to_string())?;
let weight = call.get_dispatch_info().weight;
Ok(send_message::message_payload(spec_version, weight, origin, &call))
Ok(send_message::message_payload(
spec_version,
weight,
origin,
&call,
DispatchFeePayment::AtSourceChain,
))
}
}
}