Return dispatch_fee_payment from message details RPC (#1014)

This commit is contained in:
Svyatoslav Nikolsky
2021-06-21 22:48:35 +03:00
committed by Bastian Köcher
parent ee43a560f8
commit 6ff79e9959
6 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -619,7 +619,7 @@ impl_runtime_apis! {
dispatch_weight: decoded_payload.weight,
size: message_data.payload.len() as _,
delivery_and_dispatch_fee: message_data.fee,
// TODO: include dispatch fee type (https://github.com/paritytech/parity-bridges-common/pull/911)
dispatch_fee_payment: decoded_payload.dispatch_fee_payment,
})
})
.collect()
+1 -1
View File
@@ -770,7 +770,7 @@ impl_runtime_apis! {
dispatch_weight: decoded_payload.weight,
size: message_data.payload.len() as _,
delivery_and_dispatch_fee: message_data.fee,
// TODO: include dispatch fee type (https://github.com/paritytech/parity-bridges-common/pull/911)
dispatch_fee_payment: decoded_payload.dispatch_fee_payment,
})
})
.collect()
+1 -1
View File
@@ -76,7 +76,7 @@ pub struct MessageProofParams {
pub outbound_lane_data: Option<OutboundLaneData>,
/// Proof size requirements.
pub size: ProofSize,
/// If true, dispatch fee is paid at the target chain (if supported by configuration).
/// Where the fee for dispatching message is paid?
pub dispatch_fee_payment: DispatchFeePayment,
}
@@ -121,7 +121,7 @@ pub struct MessagePayload<SourceChainAccountId, TargetChainAccountPublic, Target
pub weight: Weight,
/// Call origin to be used during dispatch.
pub origin: CallOrigin<SourceChainAccountId, TargetChainAccountPublic, TargetChainSignature>,
/// Where message dispatch fee is paid?
/// Where the fee for dispatching message is paid?
pub dispatch_fee_payment: DispatchFeePayment,
/// The call itself.
pub call: Call,
+4 -1
View File
@@ -23,6 +23,7 @@
#![allow(clippy::unnecessary_mut_passed)]
use bitvec::prelude::*;
use bp_runtime::messages::DispatchFeePayment;
use codec::{Decode, Encode};
use frame_support::RuntimeDebug;
use sp_std::{collections::vec_deque::VecDeque, prelude::*};
@@ -169,7 +170,7 @@ impl<RelayerId> InboundLaneData<RelayerId> {
}
/// Message details, returned by runtime APIs.
#[derive(Clone, Default, Encode, Decode, RuntimeDebug, PartialEq, Eq)]
#[derive(Clone, Encode, Decode, RuntimeDebug, PartialEq, Eq)]
pub struct MessageDetails<OutboundMessageFee> {
/// Nonce assigned to the message.
pub nonce: MessageNonce,
@@ -179,6 +180,8 @@ pub struct MessageDetails<OutboundMessageFee> {
pub size: u32,
/// Delivery+dispatch fee paid by the message submitter at the source chain.
pub delivery_and_dispatch_fee: OutboundMessageFee,
/// Where the fee for dispatching message is paid?
pub dispatch_fee_payment: DispatchFeePayment,
}
/// Bit vector of message dispatch results.
@@ -363,6 +363,7 @@ fn make_message_details_map<C: Chain>(
#[cfg(test)]
mod tests {
use super::*;
use bp_runtime::messages::DispatchFeePayment;
fn message_details_from_rpc(
nonces: RangeInclusive<MessageNonce>,
@@ -374,6 +375,7 @@ mod tests {
dispatch_weight: 0,
size: 0,
delivery_and_dispatch_fee: 0,
dispatch_fee_payment: DispatchFeePayment::AtSourceChain,
})
.collect()
}