Skip to content

Commit

Permalink
Update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Apr 11, 2024
1 parent 5463316 commit 038139e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/substrate/client/transaction-pool/Cargo.toml b/substrate/client/transaction-pool/Cargo.toml
index 2ca37af..1d910fe 100644
index e2a0b87..d4fde93 100644
--- a/substrate/client/transaction-pool/Cargo.toml
+++ b/substrate/client/transaction-pool/Cargo.toml
@@ -23,6 +23,6 @@ futures-timer = "3.0.2"
Expand Down
24 changes: 13 additions & 11 deletions cargo-test-fuzz/patches/substrate_node_template.patch
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
diff --git a/pallets/template/Cargo.toml b/pallets/template/Cargo.toml
index 0f01e33..5220245 100644
index b753841..1261fb7 100644
--- a/pallets/template/Cargo.toml
+++ b/pallets/template/Cargo.toml
@@ -38,2 +38,8 @@ std = [
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
@@ -57,2 +57,8 @@ try-runtime = [
"sp-runtime/try-runtime",
]
+
+[dependencies.test-fuzz]
+path = "../../../../test-fuzz"
+
+[dependencies.serde]
+version = '1.0'
diff --git a/pallets/template/src/lib.rs b/pallets/template/src/lib.rs
index 9550d3d..f9c7576 100644
index 90dfe37..1476318 100644
--- a/pallets/template/src/lib.rs
+++ b/pallets/template/src/lib.rs
@@ -62,13 +62,50 @@ pub mod pallet {
@@ -132,4 +132,31 @@ pub mod pallet {
}

+ #[cfg(test)]
Expand Down Expand Up @@ -45,18 +45,20 @@ index 9550d3d..f9c7576 100644
+ }
+ }
+
// Dispatchable functions allows users to interact with the pallet and invoke state changes.
// These functions materialize as "extrinsics", which are often compared to transactions.
// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
/// The pallet's dispatchable functions ([`Call`]s).
///
@@ -145,5 +172,9 @@ pub mod pallet {
/// The [`weight`] macro is used to assign a weight to each call.
#[pallet::call]
- impl<T: Config> Pallet<T> {
+ #[test_fuzz::test_fuzz_impl]
+ impl<T: Config> Pallet<T>
+ where
+ T: serde::Serialize,
+ {
/// An example dispatchable that takes a singles value as a parameter, writes the value to
/// storage and emits an event. This function must be dispatched by a signed extrinsic.
/// An example dispatchable that takes a single u32 value as a parameter, writes the value
/// to storage and emits an event.
@@ -153,4 +184,10 @@ pub mod pallet {
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::do_something())]
+ #[test_fuzz::test_fuzz(
Expand Down
4 changes: 2 additions & 2 deletions cargo-test-fuzz/third_party.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"flags": ["EXPENSIVE", "SKIP_NIGHTLY"],
"url": "https://github.com/paritytech/polkadot-sdk",
"rev": "12eb285dbe6271c365db7ba17cf643bfc77fe753",
"rev": "832570545b0311f533499ead57d764a2bc04145c",
"patch": "substrate_client_transaction_pool.patch",
"subdir": ".",
"package": "sc-transaction-pool",
Expand Down Expand Up @@ -47,7 +47,7 @@
{
"flags": [],
"url": "https://github.com/substrate-developer-hub/substrate-node-template",
"rev": "2ad9b78c7b56434c8036d1447120f4566583e54e",
"rev": "d70f8f9793cdd869571c21d7253faa50baaa5c5b",
"patch": "substrate_node_template.patch",
"subdir": ".",
"package": "pallet-template",
Expand Down

0 comments on commit 038139e

Please sign in to comment.