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 20, 2024
1 parent ab318a1 commit 8c70fdd
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 8c70fdd

Please sign in to comment.