mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
sp-api: Support nested transactions (#14447)
* sp-api: Support nested transactions Adds support for nested transactions in `sp-api` by using `execute_in_transaction`. This was working until a recent refactor, but this was actually not intended. However, supporting nested transactions is a worthwhile feature to have. So, this pr "brings it back" and adds a test to ensure it will not break. * Make clippy happy * Assert that the runtime api type is not unwind safe * Count number of transactions
This commit is contained in:
@@ -217,6 +217,8 @@ decl_runtime_apis! {
|
||||
fn do_trace_log();
|
||||
/// Verify the given signature, public & message bundle.
|
||||
fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec<u8>) -> bool;
|
||||
/// Write the given `value` under the given `key` into the storage and then optional panic.
|
||||
fn write_key_value(key: Vec<u8>, value: Vec<u8>, panic: bool);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,6 +608,14 @@ impl_runtime_apis! {
|
||||
fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec<u8>) -> bool {
|
||||
sp_io::crypto::ed25519_verify(&sig, &message, &public)
|
||||
}
|
||||
|
||||
fn write_key_value(key: Vec<u8>, value: Vec<u8>, panic: bool) {
|
||||
sp_io::storage::set(&key, &value);
|
||||
|
||||
if panic {
|
||||
panic!("I'm just following my master");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
|
||||
|
||||
Reference in New Issue
Block a user