mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 17:28:00 +00:00
State machine call proof backend (#3945)
* drafting a proof extraction at the hashdb level (to include everything for the 'call' proof case). * use full proof by default (replace previous proof recorder). * fix warnings. * Cache value not found in proof recorder. * Remove need or internal backend struct. * fix type. * doc
This commit is contained in:
@@ -410,7 +410,7 @@ fn generate_call_api_at_calls(decl: &ItemTrait) -> Result<TokenStream> {
|
||||
initialized_block: &std::cell::RefCell<Option<#crate_::BlockId<Block>>>,
|
||||
native_call: Option<NC>,
|
||||
context: #crate_::ExecutionContext,
|
||||
recorder: &Option<std::rc::Rc<std::cell::RefCell<#crate_::ProofRecorder<Block>>>>,
|
||||
recorder: &Option<#crate_::ProofRecorder<Block>>,
|
||||
) -> std::result::Result<#crate_::NativeOrEncoded<R>, T::Error> {
|
||||
let version = call_runtime_at.runtime_version_at(at)?;
|
||||
use #crate_::InitializeBlock;
|
||||
|
||||
@@ -257,7 +257,7 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
|
||||
commit_on_success: std::cell::RefCell<bool>,
|
||||
initialized_block: std::cell::RefCell<Option<#block_id>>,
|
||||
changes: std::cell::RefCell<#crate_::OverlayedChanges>,
|
||||
recorder: Option<std::rc::Rc<std::cell::RefCell<#crate_::ProofRecorder<#block>>>>,
|
||||
recorder: Option<#crate_::ProofRecorder<#block>>,
|
||||
}
|
||||
|
||||
// `RuntimeApi` itself is not threadsafe. However, an instance is only available in a
|
||||
@@ -300,11 +300,9 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
|
||||
self.recorder
|
||||
.take()
|
||||
.map(|recorder| {
|
||||
let trie_nodes = recorder
|
||||
.borrow_mut()
|
||||
.drain()
|
||||
.into_iter()
|
||||
.map(|record| record.data)
|
||||
let trie_nodes = recorder.read()
|
||||
.iter()
|
||||
.filter_map(|(_k, v)| v.as_ref().map(|v| v.to_vec()))
|
||||
.collect();
|
||||
#crate_::StorageProof::new(trie_nodes)
|
||||
})
|
||||
@@ -339,7 +337,7 @@ fn generate_runtime_api_base_structures(impls: &[ItemImpl]) -> Result<TokenStrea
|
||||
&Self,
|
||||
&std::cell::RefCell<#crate_::OverlayedChanges>,
|
||||
&std::cell::RefCell<Option<#crate_::BlockId<#block>>>,
|
||||
&Option<std::rc::Rc<std::cell::RefCell<#crate_::ProofRecorder<#block>>>>,
|
||||
&Option<#crate_::ProofRecorder<#block>>,
|
||||
) -> std::result::Result<#crate_::NativeOrEncoded<R>, E>,
|
||||
E,
|
||||
>(
|
||||
|
||||
Reference in New Issue
Block a user