Skip to content

Commit

Permalink
bump Substrate, Polkadot and Cumulus (#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik authored and bkontur committed May 17, 2024
1 parent d7c721e commit b32df6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 13 additions & 2 deletions bridges/primitives/messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,20 @@ impl OperatingMode for MessagesOperatingMode {

/// Lane id which implements `TypeId`.
#[derive(
Clone, Copy, Decode, Default, Encode, Eq, Ord, PartialOrd, PartialEq, TypeInfo, MaxEncodedLen,
Clone,
Copy,
Decode,
Default,
Encode,
Eq,
Ord,
PartialOrd,
PartialEq,
TypeInfo,
MaxEncodedLen,
Serialize,
Deserialize,
)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub struct LaneId(pub [u8; 4]);

impl core::fmt::Debug for LaneId {
Expand Down
8 changes: 4 additions & 4 deletions bridges/primitives/runtime/src/storage_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ use sp_trie::{
TrieDBBuilder, TrieHash,
};

use codec::{Codec, Decode, Encode};
use codec::{Decode, Encode};
use hash_db::Hasher;
use scale_info::TypeInfo;
use sp_state_machine::TrieBackend;
use trie_db::{DBValue, Recorder, Trie};

use crate::Size;
Expand Down Expand Up @@ -102,12 +101,13 @@ impl UnverifiedStorageProof {
entries: &[(RawStorageKey, Option<DBValue>)],
) -> Result<(H::Out, UnverifiedStorageProof), StorageProofError>
where
H::Out: Codec,
H::Out: codec::Codec,
{
let keys: Vec<_> = entries.iter().map(|(key, _)| key.clone()).collect();
let entries: Vec<_> =
entries.iter().cloned().map(|(key, val)| (None, vec![(key, val)])).collect();
let backend = TrieBackend::<PrefixedMemoryDB<H>, H>::from((entries, state_version));
let backend =
sp_state_machine::TrieBackend::<PrefixedMemoryDB<H>, H>::from((entries, state_version));
let root = *backend.root();

Ok((root, UnverifiedStorageProof::try_from_db(backend.backend_storage(), root, keys)?))
Expand Down

0 comments on commit b32df6e

Please sign in to comment.