mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Remove support for encoded-call messaging from relay and runtime integration code (#1376)
* remove support for encoded-call messaging * continue cleanup * continue cleanup * continue cleanup * more cleanpup * more cleanup * fmt * continue cleanup * spellcheck * rename * fix benchmarks * mention encoded-calls-messaging tag * fixing deployments * fix messages generation * fmt
This commit is contained in:
committed by
Bastian Köcher
parent
dc96aeea35
commit
d582061dff
@@ -17,7 +17,7 @@
|
||||
use crate::{
|
||||
cli::{
|
||||
bridge::FullBridge, relay_headers_and_messages::CONVERSION_RATE_ALLOWED_DIFFERENCE_RATIO,
|
||||
Balance, CliChain, HexBytes, HexLaneId, SourceConnectionParams,
|
||||
Balance, HexBytes, HexLaneId, SourceConnectionParams,
|
||||
},
|
||||
select_full_bridge,
|
||||
};
|
||||
@@ -48,7 +48,7 @@ pub struct EstimateFee {
|
||||
conversion_rate_override: Option<ConversionRateOverride>,
|
||||
/// Payload to send over the bridge.
|
||||
#[structopt(flatten)]
|
||||
payload: crate::cli::encode_message::MessagePayload,
|
||||
payload: crate::cli::encode_message::Message,
|
||||
}
|
||||
|
||||
/// A way to override conversion rate between bridge tokens.
|
||||
@@ -82,8 +82,8 @@ impl EstimateFee {
|
||||
select_full_bridge!(bridge, {
|
||||
let source_client = source.to_client::<Source>().await?;
|
||||
let lane = lane.into();
|
||||
let payload =
|
||||
Source::encode_message(payload).map_err(|e| anyhow::format_err!("{:?}", e))?;
|
||||
let payload = crate::cli::encode_message::encode_message::<Source, Target>(&payload)
|
||||
.map_err(|e| anyhow::format_err!("{:?}", e))?;
|
||||
|
||||
let fee = estimate_message_delivery_and_dispatch_fee::<Source, Target, _>(
|
||||
&source_client,
|
||||
@@ -219,14 +219,10 @@ async fn do_estimate_message_delivery_and_dispatch_fee<Source: Chain, P: Encode>
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::cli::{encode_call, RuntimeVersionType, SourceRuntimeVersionParams};
|
||||
use sp_core::crypto::Ss58Codec;
|
||||
use crate::cli::{RuntimeVersionType, SourceRuntimeVersionParams};
|
||||
|
||||
#[test]
|
||||
fn should_parse_cli_options() {
|
||||
// given
|
||||
let alice = sp_keyring::AccountKeyring::Alice.to_account_id().to_ss58check();
|
||||
|
||||
// when
|
||||
let res = EstimateFee::from_iter(vec![
|
||||
"estimate_fee",
|
||||
@@ -235,13 +231,7 @@ mod tests {
|
||||
"1234",
|
||||
"--conversion-rate-override",
|
||||
"42.5",
|
||||
"call",
|
||||
"--sender",
|
||||
&alice,
|
||||
"--dispatch-weight",
|
||||
"42",
|
||||
"remark",
|
||||
"--remark-payload",
|
||||
"raw",
|
||||
"1234",
|
||||
]);
|
||||
|
||||
@@ -262,13 +252,8 @@ mod tests {
|
||||
source_transaction_version: None,
|
||||
}
|
||||
},
|
||||
payload: crate::cli::encode_message::MessagePayload::Call {
|
||||
sender: alice.parse().unwrap(),
|
||||
call: encode_call::Call::Remark {
|
||||
remark_payload: Some(HexBytes(vec![0x12, 0x34])),
|
||||
remark_size: None,
|
||||
},
|
||||
dispatch_weight: Some(42),
|
||||
payload: crate::cli::encode_message::Message::Raw {
|
||||
data: HexBytes(vec![0x12, 0x34])
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user