mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +00:00
Child trie api changes BREAKING (#4857)
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
@@ -50,7 +50,6 @@ use sp_version::NativeVersion;
|
||||
use frame_support::{impl_outer_origin, parameter_types, weights::{Weight, RuntimeDbWeight}};
|
||||
use sp_inherents::{CheckInherentsResult, InherentData};
|
||||
use cfg_if::cfg_if;
|
||||
use sp_core::storage::ChildType;
|
||||
|
||||
// Ensure Babe and Aura use the same crypto to simplify things a bit.
|
||||
pub use sp_consensus_babe::{AuthorityId, SlotNumber};
|
||||
@@ -923,22 +922,17 @@ fn test_read_storage() {
|
||||
}
|
||||
|
||||
fn test_read_child_storage() {
|
||||
const CHILD_KEY: &[u8] = b":child_storage:default:read_child_storage";
|
||||
const UNIQUE_ID: &[u8] = b":unique_id";
|
||||
const STORAGE_KEY: &[u8] = b"unique_id_1";
|
||||
const KEY: &[u8] = b":read_child_storage";
|
||||
sp_io::storage::child_set(
|
||||
CHILD_KEY,
|
||||
UNIQUE_ID,
|
||||
ChildType::CryptoUniqueId as u32,
|
||||
sp_io::default_child_storage::set(
|
||||
STORAGE_KEY,
|
||||
KEY,
|
||||
b"test",
|
||||
);
|
||||
|
||||
let mut v = [0u8; 4];
|
||||
let r = sp_io::storage::child_read(
|
||||
CHILD_KEY,
|
||||
UNIQUE_ID,
|
||||
ChildType::CryptoUniqueId as u32,
|
||||
let r = sp_io::default_child_storage::read(
|
||||
STORAGE_KEY,
|
||||
KEY,
|
||||
&mut v,
|
||||
0,
|
||||
@@ -947,10 +941,8 @@ fn test_read_child_storage() {
|
||||
assert_eq!(&v, b"test");
|
||||
|
||||
let mut v = [0u8; 4];
|
||||
let r = sp_io::storage::child_read(
|
||||
CHILD_KEY,
|
||||
UNIQUE_ID,
|
||||
ChildType::CryptoUniqueId as u32,
|
||||
let r = sp_io::default_child_storage::read(
|
||||
STORAGE_KEY,
|
||||
KEY,
|
||||
&mut v,
|
||||
8,
|
||||
|
||||
Reference in New Issue
Block a user