mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 16:51:02 +00:00
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:
committed by
Bastian Köcher
parent
f5f73537a8
commit
88ee6bd6a0
@@ -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;
|
||||
@@ -98,7 +100,13 @@ impl CliChain for Millau {
|
||||
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,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,6 +146,7 @@ mod tests {
|
||||
call.get_dispatch_info().weight,
|
||||
bp_message_dispatch::CallOrigin::SourceRoot,
|
||||
&call,
|
||||
send_message::DispatchFeePayment::AtSourceChain,
|
||||
);
|
||||
assert_eq!(Millau::verify_message(&payload), Ok(()));
|
||||
|
||||
@@ -156,6 +157,7 @@ mod tests {
|
||||
call.get_dispatch_info().weight,
|
||||
bp_message_dispatch::CallOrigin::SourceRoot,
|
||||
&call,
|
||||
send_message::DispatchFeePayment::AtSourceChain,
|
||||
);
|
||||
assert!(Millau::verify_message(&payload).is_err());
|
||||
}
|
||||
@@ -183,6 +185,7 @@ mod tests {
|
||||
maximal_dispatch_weight,
|
||||
bp_message_dispatch::CallOrigin::SourceRoot,
|
||||
&call,
|
||||
send_message::DispatchFeePayment::AtSourceChain,
|
||||
);
|
||||
assert_eq!(Millau::verify_message(&payload), Ok(()));
|
||||
|
||||
@@ -191,6 +194,7 @@ mod tests {
|
||||
maximal_dispatch_weight + 1,
|
||||
bp_message_dispatch::CallOrigin::SourceRoot,
|
||||
&call,
|
||||
send_message::DispatchFeePayment::AtSourceChain,
|
||||
);
|
||||
assert!(Millau::verify_message(&payload).is_err());
|
||||
}
|
||||
@@ -208,6 +212,7 @@ mod tests {
|
||||
maximal_dispatch_weight,
|
||||
bp_message_dispatch::CallOrigin::SourceRoot,
|
||||
&call,
|
||||
send_message::DispatchFeePayment::AtSourceChain,
|
||||
);
|
||||
assert_eq!(Rialto::verify_message(&payload), Ok(()));
|
||||
|
||||
@@ -216,6 +221,7 @@ mod tests {
|
||||
maximal_dispatch_weight + 1,
|
||||
bp_message_dispatch::CallOrigin::SourceRoot,
|
||||
&call,
|
||||
send_message::DispatchFeePayment::AtSourceChain,
|
||||
);
|
||||
assert!(Rialto::verify_message(&payload).is_err());
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user