mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-22 19:56:20 +00:00
Remove runtime registered extensions after execution (#7236)
* Remove runtime registered extensions after execution This prevents a bug when an extension was registered in native, but the native execution aborted without removing the extension again. Now, when executing the wasm code the extension is still registered and it fails of being registered. So, the wasm execution fails as well. This can happen for example for the `VerificationExt`. * Make it better
This commit is contained in:
1 parent
8656a34289
commit
dbf4558633
7 files changed
+180
-39
No files matched your search
@@ -168,16 +168,20 @@ impl<Block: traits::Block> ExecutionExtensions<Block> {
|
||||
|
||||
if capabilities.has(offchain::Capability::TransactionPool) {
|
||||
if let Some(pool) = self.transaction_pool.read().as_ref().and_then(|x| x.upgrade()) {
|
||||
extensions.register(TransactionPoolExt(Box::new(TransactionPoolAdapter {
|
||||
at: *at,
|
||||
pool,
|
||||
}) as _));
|
||||
extensions.register(
|
||||
TransactionPoolExt(
|
||||
Box::new(TransactionPoolAdapter {
|
||||
at: *at,
|
||||
pool,
|
||||
}) as _
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if let ExecutionContext::OffchainCall(Some(ext)) = context {
|
||||
extensions.register(
|
||||
OffchainExt::new(offchain::LimitedExternalities::new(capabilities, ext.0))
|
||||
OffchainExt::new(offchain::LimitedExternalities::new(capabilities, ext.0)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user