mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
remove OutboundLaneApi::latest_received_nonce (#1262)
This commit is contained in:
committed by
Bastian Köcher
parent
13a3974f27
commit
988f6b1664
@@ -149,16 +149,19 @@ where
|
||||
&self,
|
||||
id: SourceHeaderIdOf<MessageLaneAdapter<P>>,
|
||||
) -> Result<(SourceHeaderIdOf<MessageLaneAdapter<P>>, MessageNonce), SubstrateError> {
|
||||
let encoded_response = self
|
||||
let outbound_lane_data: Option<OutboundLaneData> = self
|
||||
.client
|
||||
.state_call(
|
||||
P::TargetChain::TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD.into(),
|
||||
Bytes(self.lane_id.encode()),
|
||||
.storage_value(
|
||||
outbound_lane_data_key(
|
||||
P::TargetChain::WITH_CHAIN_MESSAGES_PALLET_NAME,
|
||||
&self.lane_id,
|
||||
),
|
||||
Some(id.1),
|
||||
)
|
||||
.await?;
|
||||
let latest_received_nonce: MessageNonce = Decode::decode(&mut &encoded_response.0[..])
|
||||
.map_err(SubstrateError::ResponseParseFailed)?;
|
||||
// lane data missing from the storage is fine until first message is sent
|
||||
let latest_received_nonce =
|
||||
outbound_lane_data.map(|data| data.latest_received_nonce).unwrap_or(0);
|
||||
Ok((id, latest_received_nonce))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user