I am trying to generate an extrinsic proof that can in turn be used to generate a partial trie and then extract the actual extrinsic for which the proof was generated from the trie, but I've not been able to figure it out yet.
Currently I'm using the trie_db::proof::generate_proof to generate the proof
This is what I've done so far https://github.com/Wizdave97/extrinsic-from-proof/blob/master/src/main.rs
The issue is the second line of this snippet returns an error 'InvalidStateRoot'
let db = sp_trie::storage_proof::StorageProof::new(proof.to_vec()).into_memory_db::<BlakeTwo256>();
let trie = sp_trie::TrieDB::<sp_trie::LayoutV0<BlakeTwo256>>::new(&db, root).unwrap();