diff --git a/neps/nep-0568.md b/neps/nep-0568.md index 6e4d9dd93..ebdcebc81 100644 --- a/neps/nep-0568.md +++ b/neps/nep-0568.md @@ -509,10 +509,14 @@ Mappings in `DBCol::ShardUIdMapping` persist as long as any descendant relies on ```rust fn set_shard_uid_mapping(&mut self, child_shard_uid: ShardUId, parent_shard_uid: ShardUId) { + let mapped_parent_shard_uid = store + .get_ser::(DBCol::StateShardUIdMapping, &parent_shard_uid.to_bytes()) + .expect("set_shard_uid_mapping() failed") + .unwrap_or(parent_shard_uid); self.store_update.set( DBCol::StateShardUIdMapping, child_shard_uid.to_bytes().as_ref(), - &borsh::to_vec(&parent_shard_uid).expect("Borsh serialize cannot fail"), + &borsh::to_vec(&mapped_parent_shard_uid).expect("Borsh serialize cannot fail"), ) } ```