mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 15:27:57 +00:00
ProofRecorder: Implement transactional support (#13769)
* TrieRecorder: Start adding support for transactions * Adds `transactions` functions and some test * More tests * Docs * Ensure that we rollback failed transactions in the storage proof * FMT * Update primitives/trie/src/recorder.rs Co-authored-by: Dmitry Markin <dmitry@markin.tech> * Review comments * Update primitives/trie/src/recorder.rs Co-authored-by: Sebastian Kunert <skunert49@gmail.com> * ".git/.scripts/commands/fmt/fmt.sh" * For the holy clippy! * Update primitives/trie/src/recorder.rs Co-authored-by: Anton <anton.kalyaev@gmail.com> --------- Co-authored-by: Dmitry Markin <dmitry@markin.tech> Co-authored-by: Sebastian Kunert <skunert49@gmail.com> Co-authored-by: command-bot <> Co-authored-by: Anton <anton.kalyaev@gmail.com>
This commit is contained in:
@@ -164,13 +164,21 @@ pub enum Extrinsic {
|
||||
OffchainIndexSet(Vec<u8>, Vec<u8>),
|
||||
OffchainIndexClear(Vec<u8>),
|
||||
Store(Vec<u8>),
|
||||
/// Read X times from the state some data and then panic!
|
||||
///
|
||||
/// Returns `Ok` if it didn't read anything.
|
||||
ReadAndPanic(u32),
|
||||
/// Read X times from the state some data.
|
||||
///
|
||||
/// Panics if it can not read `X` times.
|
||||
Read(u32),
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl serde::Serialize for Extrinsic {
|
||||
fn serialize<S>(&self, seq: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: ::serde::Serializer,
|
||||
S: serde::Serializer,
|
||||
{
|
||||
self.using_encoded(|bytes| seq.serialize_bytes(bytes))
|
||||
}
|
||||
@@ -210,6 +218,8 @@ impl BlindCheckable for Extrinsic {
|
||||
Extrinsic::OffchainIndexSet(key, value) => Ok(Extrinsic::OffchainIndexSet(key, value)),
|
||||
Extrinsic::OffchainIndexClear(key) => Ok(Extrinsic::OffchainIndexClear(key)),
|
||||
Extrinsic::Store(data) => Ok(Extrinsic::Store(data)),
|
||||
Extrinsic::ReadAndPanic(i) => Ok(Extrinsic::ReadAndPanic(i)),
|
||||
Extrinsic::Read(i) => Ok(Extrinsic::Read(i)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user