Remove deprecated code from bridge-runtime-common (#1983)

* removed FromBridgedChainMessageDispatch in favor of XcmBlobMessageDispatch

* use HaulBlobExporter/HaulBlobExporterAdapter instead of XcmBridge/XcmBridgeAdapter

* tests for sending/dispatching messages

* use new schema in testnet bridges + some cleanup

* clippy

* spelling + added TODO

* cleanup some checks

* benchmarks compilation

* all is XCM

* updated README.md

* ref issue from TODO
This commit is contained in:
Svyatoslav Nikolsky
2023-03-23 10:44:53 +03:00
committed by Bastian Köcher
parent 2407228972
commit a75c28d5b2
21 changed files with 604 additions and 889 deletions
@@ -75,10 +75,7 @@ where
let source_sign = data.source_sign.to_keypair::<Self::Source>()?;
let payload_len = payload.encoded_size();
let send_message_call = Self::Source::encode_send_xcm(
decode_xcm(payload)?,
data.bridge.bridge_instance_index(),
)?;
let send_message_call = Self::Source::encode_execute_xcm(decode_xcm(payload)?)?;
source_client
.submit_signed_extrinsic(&source_sign, move |_, transaction_nonce| {
@@ -130,7 +127,7 @@ impl SendMessage {
}
/// Decode SCALE encoded raw XCM message.
pub(crate) fn decode_xcm(message: RawMessage) -> anyhow::Result<xcm::VersionedXcm<()>> {
pub(crate) fn decode_xcm<Call>(message: RawMessage) -> anyhow::Result<xcm::VersionedXcm<Call>> {
Decode::decode(&mut &message[..])
.map_err(|e| anyhow::format_err!("Failed to decode XCM program: {:?}", e))
}